pyvsc icon indicating copy to clipboard operation
pyvsc copied to clipboard

ModuleNotFoundError: No module named 'pyboolector'

Open songzenghui opened this issue 3 years ago • 11 comments

I have installed pyvsc successfully but when i import vsc, it hint

ModuleNotFoundError: No module named 'pyboolector'

here is my pip list:

Package                   Version
------------------------- ----------------
attrs                     22.1.0
inflection                0.5.1
jsonschema                4.17.1
lxml                      4.9.1
Markdown                  3.4.1
pip                       22.3.1
PyBoolector               3.2.2.20221010.1
pyrsistent                0.19.2
python-jsonschema-objects 0.4.1
pyucis                    0.1.2.2686817964
pyvsc                     0.8.1.3466255343
PyYAML                    6.0
setuptools                65.4.1
six                       1.16.0
toposort                  1.7

my os is macos 13.0.1, python version is 3.10

songzenghui avatar Nov 27 '22 13:11 songzenghui

Hi @songzenghui, can you confirm whether you have an Arm-based or an x86-based Mac? I believe PyBoolector is currently only built for x86-based Mac, so am assuming that is your platform. Were any additional errors reported along with the ModuleNotFoundError? I would look specifically to see if any unresolved symbol errors were reported or any messages related to native library loading.

mballance avatar Nov 28 '22 16:11 mballance

yes, my mac is based x86. here is full log. i just try import vsc

Python 3.10.8 (main, Nov 15 2022, 05:25:54) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import vsc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/songzenghui/Documents/project/py-test/tutorial-env/lib/python3.10/site-packages/vsc/__init__.py", line 35, in <module>
    from vsc.attrs import *
  File "/Users/songzenghui/Documents/project/py-test/tutorial-env/lib/python3.10/site-packages/vsc/attrs.py", line 23, in <module>
    from vsc.types import type_base, field_info, type_enum
  File "/Users/songzenghui/Documents/project/py-test/tutorial-env/lib/python3.10/site-packages/vsc/types.py", line 25, in <module>
    from vsc.impl.ctor import push_expr, pop_expr, in_constraint_scope, \
  File "/Users/songzenghui/Documents/project/py-test/tutorial-env/lib/python3.10/site-packages/vsc/impl/ctor.py", line 25, in <module>
    from vsc.impl.coverage_registry import CoverageRegistry
  File "/Users/songzenghui/Documents/project/py-test/tutorial-env/lib/python3.10/site-packages/vsc/impl/coverage_registry.py", line 7, in <module>
    from vsc.model.covergroup_model import CovergroupModel
  File "/Users/songzenghui/Documents/project/py-test/tutorial-env/lib/python3.10/site-packages/vsc/model/__init__.py", line 21, in <module>
    from .model_visitor import ModelVisitor
  File "/Users/songzenghui/Documents/project/py-test/tutorial-env/lib/python3.10/site-packages/vsc/model/model_visitor.py", line 26, in <module>
    from vsc.model.constraint_model import ConstraintModel
  File "/Users/songzenghui/Documents/project/py-test/tutorial-env/lib/python3.10/site-packages/vsc/model/constraint_model.py", line 22, in <module>
    from pyboolector import BoolectorNode
ModuleNotFoundError: No module named 'pyboolector'

songzenghui avatar Dec 03 '22 03:12 songzenghui

I found pip only install dist-info, did not install the package, look at the site-packages, there is no pyboolector package, do you know why? @mballance

total 8
drwxr-xr-x  10 songzenghui  staff   320B 12  3 13:46 PyBoolector-3.2.2.20221010.1.dist-info
drwxr-xr-x   5 songzenghui  staff   160B 12  3 13:42 _distutils_hack
-rw-r--r--   1 songzenghui  staff   151B 12  3 13:42 distutils-precedence.pth
drwxr-xr-x  41 songzenghui  staff   1.3K 12  3 13:47 numpy
drwxr-xr-x  11 songzenghui  staff   352B 12  3 13:47 numpy-1.23.5.dist-info
drwxr-xr-x   9 songzenghui  staff   288B 12  3 13:42 pip
drwxr-xr-x  10 songzenghui  staff   320B 12  3 13:42 pip-22.3.1.dist-info
drwxr-xr-x   6 songzenghui  staff   192B 12  3 13:42 pkg_resources
drwxr-xr-x  48 songzenghui  staff   1.5K 12  3 13:42 setuptools
drwxr-xr-x  10 songzenghui  staff   320B 12  3 13:42 setuptools-65.4.1.dist-info

songzenghui avatar Dec 03 '22 05:12 songzenghui

What happens when you try to pip3 install PyBoolector? I tried it all in a virtualenv to try out everything fresh. Maybe retrying in a fresh environment like that might help narrow down the issue?

alwilson avatar Dec 03 '22 06:12 alwilson

Huh, the wheel files for maxosx_11_0 are only 2.5 kB versus the 2.2 MB for linux. The linux ones also come with more than just the dist-info and have the boolector binary and python wrappers. Is there something wrong with the mac build? I also don't know much about python packages and pip, so maybe there's something different to how mac packages work.

See wheel files here: https://pypi.org/project/PyBoolector/3.2.2.20221010.1/#files

alwilson avatar Dec 03 '22 06:12 alwilson

Good observation, @alwilson. Just went to check the boolector CI logs (they're using Azure, but you can still see logs from the last build). Looks like the following error was just silently ignored: image

I'll try to have a look when I have a little time...

mballance avatar Dec 04 '22 01:12 mballance

Can you take a moment to look at this question? @mballance

songzenghui avatar Dec 14 '22 11:12 songzenghui

Apologies for the delay, @songzenghui. I had a chance to look into this today and believe I've resolved the issue. I've posted a hand-created build on PyPi that you can install using pip. Because you have another version installed, I recommend installing with:

python3 -m pip install pyboolector --upgrade --force-reinstall

You should see PyBoolector-3.2.2.350174922-cp39-cp39-macosx_10_9_x86_64.whl downloaded and installed. Please confirm that this works for you, and I'll work with the Boolector team to update their continuous integration build of the Python extension.

mballance avatar Dec 17 '22 01:12 mballance

thank you. It done now with python3.9

songzenghui avatar Dec 19 '22 13:12 songzenghui

Has anyone noticed that pip still downloads v3.2.2.20221010, but the version on pypi is 3.2.2.350174922? Struggling to force install of latest 3.2.2.350* version.

taylortempleton avatar Dec 20 '22 13:12 taylortempleton