PySDD icon indicating copy to clipboard operation
PySDD copied to clipboard

import pysdd.sdd in Python3.7 vs Python3.8

Open art-ai opened this issue 5 years ago • 10 comments

I'm getting this error when I try to import pysdd.sdd using Python 3.7.

>>> import pysdd
>>> import pysdd.sdd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pysdd.sdd'
>>>

But it works fine with Python3.8. Anyone know why?

art-ai avatar Mar 05 '20 03:03 art-ai

That can occur when the SDD package did not properly compile while installing PySDD. Have you tried reinstalling it for python 3.7 (forcing a recompile to prevent reuse of erroneous wheel)? python3.7 -m pip install -vvv git+https://github.com/wannesm/PySDD.git#egg=PySDD

Also, out of interest, what does python3.7 -m pip --version say?

VincentDerk avatar Mar 05 '20 18:03 VincentDerk

I first tried the suggested command in a python 3.7 environment. The installation failed with the following log. test.log

I also tried the command in a python3.8 environment, and I change the python3.7 to python3.8 in the command. It can successfully install the pysdd, but import pysdd.sdd causes the same error as arthur reported.

hahaXD avatar Mar 05 '20 22:03 hahaXD

I fixed the problem in my distribution. The problem wasn't 3.7 vs 3.8, it seemed to be a problem with miniconda. In particular it has its own linker ld distributed with miniconda. When I rename it, I believe it now uses my system's ld, which lets pysdd compile successfully (the error messages I was getting was suggesting a bug in an older version of elfutils/binutils). I don't think this is the problem with Jason above tho, since he is not using miniconda, and he was getting different error messages than I was.

art-ai avatar Mar 05 '20 23:03 art-ai

@hahaXD Try adding the --no-use-pep517 flag?

VincentDerk avatar Mar 06 '20 00:03 VincentDerk

@VincentDerk It works. Thank you.

hahaXD avatar Mar 06 '20 08:03 hahaXD

Hi, I am still seeing this issue on OSX, using python3.7. I pip installed as suggested above: python3.7 -m pip install -vvv git+https://github.com/wannesm/PySDD.git#egg=PySDD. Also tried with the --no-use-pep517.

sbhaktha avatar Jul 24 '20 01:07 sbhaktha

@sbhaktha

  1. Did you install the python development environment (e.g. libpython3-dev, python-dev, ...), see dependencies in readme?
  2. What is the output when you install using -vvv?

VincentDerk avatar Jul 24 '20 07:07 VincentDerk

It's fixed now! I looked at the other issue (https://github.com/wannesm/PySDD/issues/18) and your proposed solution there worked: pip install -vvv --upgrade --force-reinstall --no-binary :all: --no-deps pysdd. Thanks for your response!

sbhaktha avatar Jul 24 '20 17:07 sbhaktha

I ran into the same issue when moving from system provided (Ubuntu) Python 3.8 to a fresh Python 3.9 from conda. The command @sbhaktha suggested fixed the issue.

I tried reproducing the failing state by uninstalling and reinstalling with just pip -vvv but had no luck. Once it started working it kept working.

Here is the output anyway: https://gist.github.com/VorpalBlade/6a8de21d5714c84214ce9d56061bc4c7

VorpalBlade avatar Jun 08 '21 14:06 VorpalBlade

I ran into the same issue on Python 3.10 again. Very strange.

VorpalBlade avatar Feb 01 '22 10:02 VorpalBlade