tulip-control / dd

Binary Decision Diagrams (BDDs) in pure Python and Cython wrappers of CUDD, Sylvan, and BuDDy
https://pypi.org/project/dd
Other
182 stars 39 forks source link

No module named 'dd.cudd' on Ubuntu 20.04.6 (LTS) #95

Open sskras opened 5 days ago

sskras commented 5 days ago

When I follow the instructions to install dd.cudd:

pip install --upgrade wheel cython
export DD_FETCH=1 DD_CUDD=1
pip install dd -vvv --use-pep517 --no-build-isolation
... as shown inside: ```sh root@u2004:~/debug/src/git/clone/github.com/tkieras/iscram# pip install --upgrade wheel cython Requirement already up-to-date: wheel in /usr/local/lib/python3.8/dist-packages (0.45.1) Requirement already up-to-date: cython in /usr/local/lib/python3.8/dist-packages (3.0.11) root@u2004:~/debug/src/git/clone/github.com/tkieras/iscram# export DD_FETCH=1 DD_CUDD=1 root@u2004:~/debug/src/git/clone/github.com/tkieras/iscram# pip install dd -vvv --use-pep517 --no-build-isolation Non-user install because site-packages writeable Created temporary directory: /tmp/pip-ephem-wheel-cache-8ozzssz6 Created temporary directory: /tmp/pip-req-tracker-qt6kr6ox Initialized build tracking at /tmp/pip-req-tracker-qt6kr6ox Created build tracker: /tmp/pip-req-tracker-qt6kr6ox Entered build tracker: /tmp/pip-req-tracker-qt6kr6ox Created temporary directory: /tmp/pip-install-2e7w91fm 1 location(s) to search for versions of dd: * https://pypi.org/simple/dd/ Fetching project page and analyzing links: https://pypi.org/simple/dd/ Getting page https://pypi.org/simple/dd/ Found index url https://pypi.org/simple Looking up "https://pypi.org/simple/dd/" in the cache Request header has "max_age" as 0, cache bypassed Starting new HTTPS connection (1): pypi.org:443 https://pypi.org:443 "GET /simple/dd/ HTTP/1.1" 200 2879 Updating cache with response from "https://pypi.org/simple/dd/" Caching due to etag Found link https://files.pythonhosted.org/packages/8c/6b/a88accbd1c5061014cc717bad340a7816c475e2246bb883c594c48898ce3/dd-0.0.1.tar.gz#sha256=d19dbc914392343201072a8be5e2fb6c8182609f2512a56c4ca1caf20a4f8d61 (f rom https://pypi.org/simple/dd/), version: 0.0.1 Found link https://files.pythonhosted.org/packages/8f/31/37d8e4e65178d13d2fd94d8446f719f5442d257b69394ce7b6e134b4e9e7/dd-0.0.2.tar.gz#sha256=9d9c6c6d8427b80fbf6e9f809356ba35a695b72bbd25000c0a3430e5bc2f393a (f rom https://pypi.org/simple/dd/), version: 0.0.2 Found link https://files.pythonhosted.org/packages/f1/e0/d84b9dff4e895cddc1d21a0f73ccbdacc4cf0dd4bc99c44e21933d6b9101/dd-0.0.3.tar.gz#sha256=32fd7bed0aeb1d0e139dff6826fc06efdea539509c8af696af95b2b2fbf86074 (f rom https://pypi.org/simple/dd/), version: 0.0.3 Found link https://files.pythonhosted.org/packages/9b/27/1e71c6f4511fb2fc5456a08ab338a937107269202b9dbf6cc6b58445a439/dd-0.0.4.tar.gz#sha256=ff5ed5774f8c7eab7de094f737a9465fe989bcaa6200bd3dd3eee7509dc22740 (f rom https://pypi.org/simple/dd/), version: 0.0.4 Found link https://files.pythonhosted.org/packages/e5/04/0a79295cb9b384acfb73e2f09c06e245f94e7ac738f721c2f7819bccee35/dd-0.1.1.tar.gz#sha256=6ff015439bafd254600ea8e6cccb777d50a7138e9f12cca0065b185f376e7c50 (f rom https://pypi.org/simple/dd/), version: 0.1.1 [...] Building wheels for collected packages: dd, astutils, ply Created temporary directory: /tmp/pip-wheel-cxwngvrq Destination directory: /tmp/pip-wheel-cxwngvrq Running command /usr/bin/python3 /tmp/tmp0ajrijwy build_wheel /tmp/tmpnivjwhlq No git info: Assume release. WARNING: `dd` could not cache parser tables (ignore this if running only for "egg_info"). running bdist_wheel running build running build_py Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt Generating grammar tables from /usr/lib/python3.8/lib2to3/PatternGrammar.txt creating build creating build/lib creating build/lib/dd copying dd/_copy.py -> build/lib/dd copying dd/_compat.py -> build/lib/dd copying dd/__init__.py -> build/lib/dd copying dd/mdd.py -> build/lib/dd copying dd/_version.py -> build/lib/dd copying dd/_utils.py -> build/lib/dd copying dd/autoref.py -> build/lib/dd copying dd/_abc.py -> build/lib/dd copying dd/bdd.py -> build/lib/dd copying dd/_parser.py -> build/lib/dd copying dd/dddmp.py -> build/lib/dd running egg_info writing dd.egg-info/PKG-INFO writing dependency_links to dd.egg-info/dependency_links.txt writing requirements to dd.egg-info/requires.txt writing top-level names to dd.egg-info/top_level.txt reading manifest file 'dd.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'dd/CUDD_LICENSE' warning: no files found matching 'dd/GLIBC_COPYING.LIB' warning: no files found matching 'dd/GLIBC_LICENSES' warning: no files found matching 'dd/PYTHON_LICENSE' writing manifest file 'dd.egg-info/SOURCES.txt' copying dd/_cudd_addendum.c -> build/lib/dd copying dd/buddy.pyx -> build/lib/dd copying dd/buddy_.pxd -> build/lib/dd copying dd/c_sylvan.pxd -> build/lib/dd copying dd/cudd.c -> build/lib/dd copying dd/cudd.pyx -> build/lib/dd copying dd/cudd_zdd.c -> build/lib/dd copying dd/cudd_zdd.pyx -> build/lib/dd copying dd/sylvan.c -> build/lib/dd copying dd/sylvan.pyx -> build/lib/dd installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/_abc.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/_utils.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/buddy_.pxd -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/mdd.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/__init__.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/_copy.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/buddy.pyx -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/cudd.pyx -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/_version.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/_compat.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/sylvan.c -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/dddmp.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/sylvan.pyx -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/cudd_zdd.pyx -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/bdd.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/_parser.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/_cudd_addendum.c -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/cudd_zdd.c -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/autoref.py -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/c_sylvan.pxd -> build/bdist.linux-x86_64/wheel/dd copying build/lib/dd/cudd.c -> build/bdist.linux-x86_64/wheel/dd running install_egg_info Copying dd.egg-info to build/bdist.linux-x86_64/wheel/dd-0.5.7.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/dd-0.5.7.dist-info/WHEEL creating '/tmp/pip-wheel-cxwngvrq/tmpokwfquqi/dd-0.5.7-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'dd/__init__.py' adding 'dd/_abc.py' adding 'dd/_compat.py' adding 'dd/_copy.py' adding 'dd/_cudd_addendum.c' adding 'dd/_parser.py' adding 'dd/_utils.py' adding 'dd/_version.py' adding 'dd/autoref.py' adding 'dd/bdd.py' adding 'dd/buddy.pyx' adding 'dd/buddy_.pxd' adding 'dd/c_sylvan.pxd' adding 'dd/cudd.c' adding 'dd/cudd.pyx' adding 'dd/cudd_zdd.c' adding 'dd/cudd_zdd.pyx' adding 'dd/dddmp.py' adding 'dd/mdd.py' adding 'dd/sylvan.c' adding 'dd/sylvan.pyx' adding 'dd-0.5.7.dist-info/LICENSE' adding 'dd-0.5.7.dist-info/METADATA' adding 'dd-0.5.7.dist-info/WHEEL' adding 'dd-0.5.7.dist-info/top_level.txt' adding 'dd-0.5.7.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Building wheel for dd (PEP 517) ... done Created wheel for dd: filename=dd-0.5.7-py3-none-any.whl size=678715 sha256=d325c8d293136485189ab63fbfdc1c9b6182b95b4c171389598040d267208c80 Stored in directory: /root/.cache/pip/wheels/85/3c/12/0072fa73cd5e197875e7a474db7f5cc9f3d4528aead140f350 Created temporary directory: /tmp/pip-wheel-6h13d58t Destination directory: /tmp/pip-wheel-6h13d58t Running command /usr/bin/python3 /tmp/tmpmkpsg6fu build_wheel /tmp/tmprj4u3v_1 running bdist_wheel running build running build_py Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt Generating grammar tables from /usr/lib/python3.8/lib2to3/PatternGrammar.txt creating build creating build/lib creating build/lib/astutils copying astutils/__init__.py -> build/lib/astutils copying astutils/ast.py -> build/lib/astutils copying astutils/_version.py -> build/lib/astutils copying astutils/ply.py -> build/lib/astutils installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/astutils copying build/lib/astutils/_version.py -> build/bdist.linux-x86_64/wheel/astutils copying build/lib/astutils/ast.py -> build/bdist.linux-x86_64/wheel/astutils copying build/lib/astutils/__init__.py -> build/bdist.linux-x86_64/wheel/astutils copying build/lib/astutils/ply.py -> build/bdist.linux-x86_64/wheel/astutils running install_egg_info running egg_info writing astutils.egg-info/PKG-INFO writing dependency_links to astutils.egg-info/dependency_links.txt writing requirements to astutils.egg-info/requires.txt writing top-level names to astutils.egg-info/top_level.txt reading manifest file 'astutils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'astutils.egg-info/SOURCES.txt' Copying astutils.egg-info to build/bdist.linux-x86_64/wheel/astutils-0.0.5.egg-info running install_scripts adding license file "LICENSE" (matched pattern "LICEN[CS]E*") creating build/bdist.linux-x86_64/wheel/astutils-0.0.5.dist-info/WHEEL creating '/tmp/pip-wheel-6h13d58t/tmpz44k1vwp/astutils-0.0.5-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'astutils/__init__.py' adding 'astutils/_version.py' adding 'astutils/ast.py' adding 'astutils/ply.py' adding 'astutils-0.0.5.dist-info/LICENSE' adding 'astutils-0.0.5.dist-info/METADATA' adding 'astutils-0.0.5.dist-info/WHEEL' adding 'astutils-0.0.5.dist-info/top_level.txt' adding 'astutils-0.0.5.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Building wheel for astutils (PEP 517) ... done Created wheel for astutils: filename=astutils-0.0.5-py3-none-any.whl size=6274 sha256=b9ce8639abb69098c9491e1b3e0281bb4bfd8cd0fc63dc30783827939457c19a Stored in directory: /root/.cache/pip/wheels/49/fc/6d/0d7de2e091b614a946ce42ccd8d1e321b8b92da682d93b3d67 Created temporary directory: /tmp/pip-wheel-nq5gq5ik Destination directory: /tmp/pip-wheel-nq5gq5ik Running command /usr/bin/python3 /tmp/tmpog6cmi85 build_wheel /tmp/tmp02dtjilx running bdist_wheel running build running build_py Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt Generating grammar tables from /usr/lib/python3.8/lib2to3/PatternGrammar.txt creating build creating build/lib creating build/lib/ply copying ply/ctokens.py -> build/lib/ply copying ply/__init__.py -> build/lib/ply copying ply/cpp.py -> build/lib/ply copying ply/yacc.py -> build/lib/ply copying ply/ygen.py -> build/lib/ply copying ply/lex.py -> build/lib/ply installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/ply copying build/lib/ply/cpp.py -> build/bdist.linux-x86_64/wheel/ply copying build/lib/ply/yacc.py -> build/bdist.linux-x86_64/wheel/ply copying build/lib/ply/ygen.py -> build/bdist.linux-x86_64/wheel/ply copying build/lib/ply/lex.py -> build/bdist.linux-x86_64/wheel/ply copying build/lib/ply/__init__.py -> build/bdist.linux-x86_64/wheel/ply copying build/lib/ply/ctokens.py -> build/bdist.linux-x86_64/wheel/ply running install_egg_info running egg_info writing ply.egg-info/PKG-INFO writing dependency_links to ply.egg-info/dependency_links.txt writing top-level names to ply.egg-info/top_level.txt reading manifest file 'ply.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found anywhere in distribution writing manifest file 'ply.egg-info/SOURCES.txt' Copying ply.egg-info to build/bdist.linux-x86_64/wheel/ply-3.10.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/ply-3.10.dist-info/WHEEL creating '/tmp/pip-wheel-nq5gq5ik/tmpcj_0nkyl/ply-3.10-py2.py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'ply/__init__.py' adding 'ply/cpp.py' adding 'ply/ctokens.py' adding 'ply/lex.py' adding 'ply/yacc.py' adding 'ply/ygen.py' adding 'ply-3.10.dist-info/METADATA' adding 'ply-3.10.dist-info/WHEEL' adding 'ply-3.10.dist-info/top_level.txt' adding 'ply-3.10.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Building wheel for ply (PEP 517) ... done Created wheel for ply: filename=ply-3.10-py2.py3-none-any.whl size=48434 sha256=b8239888d7e14e43b59531307df05dc6c5b0c601661f27ffef4eb9fc914435da Stored in directory: /root/.cache/pip/wheels/21/91/ea/6ed510c477d33b04818aeab5aac65f6c9bdab89460fb01e349 Successfully built dd astutils ply Installing collected packages: networkx, pyparsing, pydot, ply, astutils, psutil, dd Created temporary directory: /tmp/pip-unpacked-wheel-kufngque Created temporary directory: /tmp/pip-unpacked-wheel-0gmjys5p Created temporary directory: /tmp/pip-unpacked-wheel-az0dxvtz Attempting uninstall: ply Found existing installation: ply 3.11 Uninstalling ply-3.11: Created temporary directory: /usr/local/lib/python3.8/dist-packages/~ly-3.11.dist-info Removing file or directory /usr/local/lib/python3.8/dist-packages/ply-3.11.dist-info/ Created temporary directory: /usr/local/lib/python3.8/dist-packages/~ly Removing file or directory /usr/local/lib/python3.8/dist-packages/ply/ Successfully uninstalled ply-3.11 Created temporary directory: /tmp/pip-unpacked-wheel-bu3eofo9 Created temporary directory: /tmp/pip-unpacked-wheel-wdyfpolz Created temporary directory: /tmp/pip-unpacked-wheel-qme89x8n Created temporary directory: /tmp/pip-unpacked-wheel-yme2sk2t Successfully installed astutils-0.0.5 dd-0.5.7 networkx-3.1 ply-3.10 psutil-6.1.0 pydot-3.0.2 pyparsing-3.1.4 Cleaning up... Removing source in /tmp/pip-install-2e7w91fm/dd Removing source in /tmp/pip-install-2e7w91fm/astutils Removing source in /tmp/pip-install-2e7w91fm/ply Removed build tracker: '/tmp/pip-req-tracker-qt6kr6ox' ```

... then the minimal test throws the following error:

root@u2004:~/debug/src/git/clone/github.com/tkieras/iscram# python3 -c "import dd.cudd"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'dd.cudd'

Any ideas on how to proceed?

sskras commented 5 days ago

Python version:

root@u2004:~/debug/src/github.com/tulip-control/dd# python3 --version
Python 3.8.10

If I cd to the cloned dir, and replace install dd with install . then I get SyntaxError:

(ouput collapsed) ```sh root@u2004:~/debug/src/github.com/tulip-control/dd# pip install . -vvv --use-pep517 --no-build-isolation Non-user install because site-packages writeable Created temporary directory: /tmp/pip-ephem-wheel-cache-uog5s6n1 Created temporary directory: /tmp/pip-req-tracker-p8cnpfsk Initialized build tracking at /tmp/pip-req-tracker-p8cnpfsk Created build tracker: /tmp/pip-req-tracker-p8cnpfsk Entered build tracker: /tmp/pip-req-tracker-p8cnpfsk Created temporary directory: /tmp/pip-install-2lpygf4_ Processing /root/debug/src/github.com/tulip-control/dd Created temporary directory: /tmp/pip-req-build-jv_mye3z Added file:///root/debug/src/github.com/tulip-control/dd to build tracker '/tmp/pip-req-tracker-p8cnpfsk' Created temporary directory: /tmp/pip-modern-metadata-kcm8btb9 Running command /usr/bin/python3 /tmp/tmp6zrli2_t prepare_metadata_for_build_wheel /tmp/tmpcftv70c0 Traceback (most recent call last): File "/tmp/tmp6zrli2_t", line 280, in main() File "/tmp/tmp6zrli2_t", line 263, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/tmp/tmp6zrli2_t", line 133, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in prepare_metadata_for_build_wheel self.run_setup() File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 249, in run_setup super(_BuildMetaLegacyBackend, File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 143, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 9, in import download File "/tmp/pip-req-build-jv_mye3z/download.py", line 345 match algo: ^ SyntaxError: invalid syntax Preparing wheel metadata ... error Cleaning up... Removing source in /tmp/pip-req-build-jv_mye3z Removed file:///root/debug/src/github.com/tulip-control/dd from build tracker '/tmp/pip-req-tracker-p8cnpfsk' Removed build tracker: '/tmp/pip-req-tracker-p8cnpfsk' ERROR: Command errored out with exit status 1: /usr/bin/python3 /tmp/tmp6zrli2_t prepare_metadata_for_build_wheel /tmp/tmpcftv70c0 Check the logs for full command output. ERROR: Command errored out with exit status 1: /usr/bin/python3 /tmp/tmp6zrli2_t prepare_metadata_for_build_wheel /tmp/tmpcftv70c0 Check the logs for full command output. Exception information: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 186, in _main status = self.run(options, args) File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 357, in run resolver.resolve(requirement_set) File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 177, in resolve discovered_reqs.extend(self._resolve_one(requirement_set, req)) File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for abstract_dist = self.preparer.prepare_linked_requirement(req) File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 515, in prepare_linked_requirement abstract_dist = _get_prepared_distribution( File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution abstract_dist.prepare_distribution_metadata(finder, build_isolation) File "/usr/lib/python3/dist-packages/pip/_internal/distributions/sdist.py", line 40, in prepare_distribution_metadata self.req.prepare_metadata() File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 564, in prepare_metadata self.metadata_directory = self._generate_metadata() File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 549, in _generate_metadata return generate_metadata( File "/usr/lib/python3/dist-packages/pip/_internal/operations/build/metadata.py", line 36, in generate_metadata distinfo_dir = backend.prepare_metadata_for_build_wheel( File "/usr/share/python-wheels/pep517-0.8.2-py2.py3-none-any.whl/pep517/wrappers.py", line 176, in prepare_metadata_for_build_wheel return self._call_hook('prepare_metadata_for_build_wheel', { File "/usr/share/python-wheels/pep517-0.8.2-py2.py3-none-any.whl/pep517/wrappers.py", line 255, in _call_hook self._subprocess_runner( File "/usr/lib/python3/dist-packages/pip/_internal/utils/subprocess.py", line 271, in runner call_subprocess( File "/usr/lib/python3/dist-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess raise InstallationError(exc_msg) pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /usr/bin/python3 /tmp/tmp6zrli2_t prepare_metadata_for_build_wheel /tmp/tmpcftv70c0 Check the logs for full command output. ```
sskras commented 5 days ago

OK, since the project now requires Python 3.11, I rolled back to v0.5.6, and install . went fine:

root@u2004:~/debug/src/github.com/tulip-control/dd# git checkout --detach v0.5.6
HEAD is now at 2842503 REL: update test files included by `MANIFEST.in`
root@u2004:~/debug/src/github.com/tulip-control/dd# export DD_FETCH=1 DD_CUDD=1
root@u2004:~/debug/src/github.com/tulip-control/dd# pip install . -vvv --use-pep517 --no-build-isolation
Non-user install because site-packages writeable
Created temporary directory: /tmp/pip-ephem-wheel-cache-tt5zf9a7
Created temporary directory: /tmp/pip-req-tracker-8169_1ka
Initialized build tracking at /tmp/pip-req-tracker-8169_1ka
Created build tracker: /tmp/pip-req-tracker-8169_1ka
Entered build tracker: /tmp/pip-req-tracker-8169_1ka
Created temporary directory: /tmp/pip-install-xnn383az
Processing /root/debug/src/github.com/tulip-control/dd
  Created temporary directory: /tmp/pip-req-build-nbejb_vf
  Added file:///root/debug/src/github.com/tulip-control/dd to build tracker '/tmp/pip-req-tracker-8169_1ka'
    Created temporary directory: /tmp/pip-modern-metadata-4i671gow
    Running command /usr/bin/python3 /tmp/tmpld17_f2o prepare_metadata_for_build_wheel /tmp/tmph3mhrxhw
    No git info: Assume release.
    running dist_info
    creating /tmp/pip-modern-metadata-4i671gow/dd.egg-info
    writing /tmp/pip-modern-metadata-4i671gow/dd.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-modern-metadata-4i671gow/dd.egg-info/dependency_links.txt
    writing requirements to /tmp/pip-modern-metadata-4i671gow/dd.egg-info/requires.txt
    writing top-level names to /tmp/pip-modern-metadata-4i671gow/dd.egg-info/top_level.txt
    writing manifest file '/tmp/pip-modern-metadata-4i671gow/dd.egg-info/SOURCES.txt'
    reading manifest file '/tmp/pip-modern-metadata-4i671gow/dd.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    Generating LALR tables
    Generating LALR tables
    warning: no files found matching 'dd/CUDD_LICENSE'
    warning: no files found matching 'dd/GLIBC_COPYING.LIB'
    warning: no files found matching 'dd/GLIBC_LICENSES'
    warning: no files found matching 'dd/PYTHON_LICENSE'
    writing manifest file '/tmp/pip-modern-metadata-4i671gow/dd.egg-info/SOURCES.txt'
    creating '/tmp/pip-modern-metadata-4i671gow/dd.dist-info'
    Preparing wheel metadata ... done
  Source in /tmp/pip-req-build-nbejb_vf has version 0.5.6, which satisfies requirement dd==0.5.6 from file:///root/debug/src/github.com/tulip-control/dd
  Removed dd==0.5.6 from file:///root/debug/src/github.com/tulip-control/dd from build tracker '/tmp/pip-req-tracker-8169_1ka'
Requirement already satisfied: networkx>=1.9.1 in /usr/local/lib/python3.8/dist-packages (from dd==0.5.6) (3.1)
Requirement already satisfied: psutil>=3.2.2 in /usr/local/lib/python3.8/dist-packages (from dd==0.5.6) (6.1.0)
Requirement already satisfied: ply<=3.10,>=3.4 in /usr/local/lib/python3.8/dist-packages (from dd==0.5.6) (3.10)
Requirement already satisfied: pydot>=1.2.2 in /usr/local/lib/python3.8/dist-packages (from dd==0.5.6) (3.0.2)
Requirement already satisfied: setuptools>=19.6 in /usr/lib/python3/dist-packages (from dd==0.5.6) (45.2.0)
Requirement already satisfied: astutils>=0.0.1 in /usr/local/lib/python3.8/dist-packages (from dd==0.5.6) (0.0.5)
Requirement already satisfied: pyparsing>=3.0.9 in /usr/local/lib/python3.8/dist-packages (from pydot>=1.2.2->dd==0.5.6) (3.1.4)

And I am back to the original error:

root@u2004:~/debug/src/github.com/tulip-control/dd# python3 -c "import dd"
root@u2004:~/debug/src/github.com/tulip-control/dd# python3 -c "import dd.cudd"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'dd.cudd'
johnyf commented 5 days ago

The way of building dd.cudd has changed from dd == 0.5.7 to dd == 0.6.0, following changes in pip and setuptools.

For dd <= 0.5.7, running python setup.py install --fetch --cudd --cudd_zdd is expected to work. https://github.com/tulip-control/dd/tree/v0.5.7

Also, to import dd.cudd it is necessary to change to a directory other than the repository's root, for example to tests/. The reason is to import from site-packages, instead of the local directory dd. Whether the dd directory contains dd.cudd depends on how dd was built and installed. So:

python setup.py install --fetch --cudd --cudd_zdd
cd tests
python -c 'import dd.cudd'

For dd >= 0.6.0, export DD_FETCH=1 DD_CUDD=1 works:

pip install --upgrade wheel cython
export DD_FETCH=1 DD_CUDD=1
pip install dd -vvv --use-pep517 --no-build-isolation

or

pip install --upgrade build wheel cython
export DD_FETCH=1 DD_CUDD=1
python -m build --no-isolation

https://github.com/tulip-control/dd/blob/v0.6.0/doc.md#using-the-package-build

sskras commented 4 days ago

@johnyf commented yesterday:

The way of building dd.cudd has changed from dd == 0.5.7 to dd == 0.6.0, following changes in pip and setuptools.

For dd <= 0.5.7, running python setup.py install --fetch --cudd --cudd_zdd is expected to work. https://github.com/tulip-control/dd/tree/v0.5.7

Thanks, this matches the last line from RUN recipe I am trying to fix:

RUN git clone https://github.com/tulip-control/dd.git; \
    cd dd; \
    python3 -m ensurepip; \
    pip install cython; \
    python setup.py install --fetch --cudd

I repeated the whole recipe:

(the long output collapsed) ```shell root@u2004:~/debug/src/github.com/tulip-control/dd.git# git checkout --detach v0.5.6 HEAD is now at 2842503 REL: update test files included by `MANIFEST.in` ``` ```shell root@u2004:~/debug/src/github.com/tulip-control/dd.git# python3 -m ensurepip ensurepip is disabled in Debian/Ubuntu for the system python. Python modules for the system python are usually handled by dpkg and apt-get. apt install python3- Install the python3-pip package to use pip itself. Using pip together with the system python might have unexpected results for any system installed module, so use it on your own risk, or make sure to only use it in virtual environments. ``` ```shell root@u2004:~/debug/src/github.com/tulip-control/dd.git# pip install cython==0.29.21 Collecting cython==0.29.21 Downloading Cython-0.29.21-py2.py3-none-any.whl (974 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 974.2/974.2 KB 7.7 MB/s eta 0:00:00 Installing collected packages: cython Successfully installed cython-0.29.21 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/wa rnings/venv ``` ```shell root@u2004:~/debug/src/github.com/tulip-control/dd.git# python3 setup.py install --fetch --cudd ++ download: https://sourceforge.net/projects/cudd-mirror/files/cudd-3.0.0.tar.gz/download -- done downloading. ++ unpack: cudd-3.0.0.tar.gz -- done unpacking. checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes [...] configure: creating ./config.status config.status: creating Makefile config.status: creating dddmp/exp/test1.sh config.status: creating dddmp/exp/test2.sh config.status: creating dddmp/exp/test3.sh config.status: creating dddmp/exp/test4.sh config.status: creating dddmp/exp/test5.sh config.status: creating dddmp/exp/test6.sh config.status: creating dddmp/exp/test7.sh config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands -------------------------------------------------- Configuration summary for cudd 3.0.0 Build system : x86_64-unknown-linux-gnu Host system : x86_64-unknown-linux-gnu Prefix : '/usr/local' Compilers : 'gcc -fPIC -std=c99' : 'g++ -Wall -Wextra -std=c++0x -g -O3' Shared library : no dddmp enabled : no obj enabled : no -------------------------------------------------- make all-am make[1]: Entering directory '/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0' /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./cudd -I./st -I./epd -I./mtr -I./util -fPIC -std=c99 -MT cudd/cudd_libcudd_la-cuddAddAbs.lo -MD -MP -MF cudd/.deps/cudd_libcudd_la-cu ddAddAbs.Tpo -c -o cudd/cudd_libcudd_la-cuddAddAbs.lo `test -f 'cudd/cuddAddAbs.c' || echo './'`cudd/cuddAddAbs.c [...] libtool: link: ranlib cplusplus/.libs/libobj.a libtool: link: ( cd "cplusplus/.libs" && rm -f "libobj.la" && ln -s "../libobj.la" "libobj.la" ) make[1]: Leaving directory '/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0' Compiling dd/cudd.pyx because it changed. [1/1] Cythonizing dd/cudd.pyx warning: dd/cudd.pyx:74:4: 'DdNode' redeclared warning: dd/cudd.pyx:76:4: 'DdManager' redeclared No git info: Assume release. WARNING: `dd` could not cache parser tables (ignore this if running only for "egg_info"). running install /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info creating dd.egg-info writing dd.egg-info/PKG-INFO writing dependency_links to dd.egg-info/dependency_links.txt writing requirements to dd.egg-info/requires.txt writing top-level names to dd.egg-info/top_level.txt writing manifest file 'dd.egg-info/SOURCES.txt' reading manifest file 'dd.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'dd/CUDD_LICENSE' warning: no files found matching 'dd/GLIBC_COPYING.LIB' warning: no files found matching 'dd/GLIBC_LICENSES' warning: no files found matching 'dd/PYTHON_LICENSE' adding license file 'LICENSE' writing manifest file 'dd.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build creating build/lib.linux-x86_64-3.10 creating build/lib.linux-x86_64-3.10/dd copying dd/_utils.py -> build/lib.linux-x86_64-3.10/dd copying dd/_abc.py -> build/lib.linux-x86_64-3.10/dd copying dd/dddmp.py -> build/lib.linux-x86_64-3.10/dd copying dd/bdd.py -> build/lib.linux-x86_64-3.10/dd copying dd/_parser.py -> build/lib.linux-x86_64-3.10/dd copying dd/autoref.py -> build/lib.linux-x86_64-3.10/dd copying dd/__init__.py -> build/lib.linux-x86_64-3.10/dd copying dd/mdd.py -> build/lib.linux-x86_64-3.10/dd copying dd/_copy.py -> build/lib.linux-x86_64-3.10/dd copying dd/_compat.py -> build/lib.linux-x86_64-3.10/dd copying dd/_version.py -> build/lib.linux-x86_64-3.10/dd copying dd/_cudd_addendum.c -> build/lib.linux-x86_64-3.10/dd copying dd/buddy.pyx -> build/lib.linux-x86_64-3.10/dd copying dd/buddy_.pxd -> build/lib.linux-x86_64-3.10/dd copying dd/c_sylvan.pxd -> build/lib.linux-x86_64-3.10/dd copying dd/cudd.c -> build/lib.linux-x86_64-3.10/dd copying dd/cudd.pyx -> build/lib.linux-x86_64-3.10/dd copying dd/cudd_zdd.pyx -> build/lib.linux-x86_64-3.10/dd copying dd/sylvan.pyx -> build/lib.linux-x86_64-3.10/dd running build_ext building 'dd.cudd' extension creating build/temp.linux-x86_64-3.10 creating build/temp.linux-x86_64-3.10/dd gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdat e-time -D_FORTIFY_SOURCE=2 -fPIC -Idd -I/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0/. -I/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0/cudd -I/root/debug/src/github.com/tulip-control/ dd.git/cudd-3.0.0/dddmp -I/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0/epd -I/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0/mtr -I/root/debug/src/github.com/tulip-control/dd.git/cudd-3 .0.0/st -I/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0/util -I/usr/include/python3.10 -c dd/cudd.c -o build/temp.linux-x86_64-3.10/dd/cudd.o -fPIC -std=c99 -DBSD -DHAVE_IEEE_754 -mtune=native -pth read -fwrapv -fno-strict-aliasing -Wall -W -O3 -DSIZEOF_LONG=8 -DSIZEOF_VOID_P=8 dd/cudd.c: In function ‘__Pyx_Coroutine_Send’: dd/cudd.c:39147:19: warning: implicit declaration of function ‘_PyGen_Send’; did you mean ‘_PyGen_yf’? [-Wimplicit-function-declaration] 39147 | ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); | ^~~~~~~~~~~ | _PyGen_yf dd/cudd.c:39147:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 39147 | ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); | ^ dd/cudd.c:39152:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 39152 | ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); | ^ dd/cudd.c: In function ‘__Pyx_Generator_Next’: dd/cudd.c:39236:17: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 39236 | ret = _PyGen_Send((PyGenObject*)yf, NULL); | ^ dd/cudd.c: In function ‘__pyx_f_2dd_4cudd_3BDD__dump_dddmp’: dd/cudd.c:20919:16: warning: ‘__pyx_v_f’ may be used uninitialized in this function [-Wmaybe-uninitialized] 20919 | (void)(fclose(__pyx_v_f)); | ~^~~~~~~~~~~~~~~~~~ dd/cudd.c: In function ‘__pyx_f_2dd_4cudd_3BDD__load_dddmp’: dd/cudd.c:21888:16: warning: ‘__pyx_v_f’ may be used uninitialized in this function [-Wmaybe-uninitialized] 21888 | (void)(fclose(__pyx_v_f)); | ~^~~~~~~~~~~~~~~~~~ x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate- time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.10/dd/cudd.o -L/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0/cudd/.libs -L/root/debug/src/github.com/tulip-control/dd.git/cudd-3.0.0/dddmp/.libs - lcudd -ldddmp -o build/lib.linux-x86_64-3.10/dd/cudd.cpython-310-x86_64-linux-gnu.so creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/cudd.c -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/cudd.cpython-310-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/_copy.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/autoref.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/cudd.pyx -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/_utils.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/_parser.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/buddy.pyx -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/bdd.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/sylvan.pyx -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/_compat.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/cudd_zdd.pyx -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/_cudd_addendum.c -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/_abc.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/__init__.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/mdd.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/dddmp.py -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/buddy_.pxd -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/c_sylvan.pxd -> build/bdist.linux-x86_64/egg/dd copying build/lib.linux-x86_64-3.10/dd/_version.py -> build/bdist.linux-x86_64/egg/dd byte-compiling build/bdist.linux-x86_64/egg/dd/_copy.py to _copy.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/autoref.py to autoref.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/_utils.py to _utils.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/_parser.py to _parser.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/bdd.py to bdd.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/_compat.py to _compat.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/_abc.py to _abc.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/__init__.py to __init__.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/mdd.py to mdd.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/dddmp.py to dddmp.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/dd/_version.py to _version.cpython-310.pyc creating stub loader for dd/cudd.cpython-310-x86_64-linux-gnu.so byte-compiling build/bdist.linux-x86_64/egg/dd/cudd.py to cudd.cpython-310.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying dd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying dd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying dd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying dd.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying dd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt zip_safe flag not set; analyzing archive contents... dd.__pycache__.cudd.cpython-310: module references __file__ creating dist creating 'dist/dd-0.5.6-py3.10-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing dd-0.5.6-py3.10-linux-x86_64.egg creating /usr/local/lib/python3.10/dist-packages/dd-0.5.6-py3.10-linux-x86_64.egg Extracting dd-0.5.6-py3.10-linux-x86_64.egg to /usr/local/lib/python3.10/dist-packages Adding dd 0.5.6 to easy-install.pth file Installed /usr/local/lib/python3.10/dist-packages/dd-0.5.6-py3.10-linux-x86_64.egg Processing dependencies for dd==0.5.6 Searching for pydot>=1.2.2 Reading https://pypi.org/simple/pydot/ /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release warnings.warn( Downloading https://files.pythonhosted.org/packages/a7/e4/463fd46922e0b0b369305662f85f1c70dcc1cde1584906cf8defed8308a3/pydot-3.0.2-py3-none-any.whl#sha256=99cedaa55d04abb0b2bc56d9981a6da781053dd5ac75c428e8dd53d b53f90b14 Best match: pydot 3.0.2 Processing pydot-3.0.2-py3-none-any.whl Installing pydot-3.0.2-py3-none-any.whl to /usr/local/lib/python3.10/dist-packages Adding pydot 3.0.2 to easy-install.pth file Installed /usr/local/lib/python3.10/dist-packages/pydot-3.0.2-py3.10.egg Searching for psutil>=3.2.2 Reading https://pypi.org/simple/psutil/ Downloading https://files.pythonhosted.org/packages/58/4d/8245e6f76a93c98aab285a43ea71ff1b171bcd90c9d238bf81f7021fb233/psutil-6.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.man ylinux2014_x86_64.whl#sha256=498c6979f9c6637ebc3a73b3f87f9eb1ec24e1ce53a7c5173b8508981614a90b Best match: psutil 6.1.0 Processing psutil-6.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl Installing psutil-6.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl to /usr/local/lib/python3.10/dist-packages Adding psutil 6.1.0 to easy-install.pth file Installed /usr/local/lib/python3.10/dist-packages/psutil-6.1.0-py3.10-linux-x86_64.egg Searching for ply<=3.10,>=3.4 Reading https://pypi.org/simple/ply/ Downloading https://files.pythonhosted.org/packages/ce/3d/1f9ca69192025046f02a02ffc61bfbac2731aab06325a218370fd93e18df/ply-3.10.tar.gz#sha256=96e94af7dd7031d8d6dd6e2a8e0de593b511c211a86e28a9c9621c275ac8bacb Best match: ply 3.10 Processing ply-3.10.tar.gz Writing /tmp/easy_install-dkk_76jf/ply-3.10/setup.cfg Running ply-3.10/setup.py -q bdist_egg --dist-dir /tmp/easy_install-dkk_76jf/ply-3.10/egg-dist-tmp-7ong_s14 /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( warning: no previously-included files matching '*.pyc' found anywhere in distribution /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( zip_safe flag not set; analyzing archive contents... ply.__pycache__.lex.cpython-310: module references __file__ ply.__pycache__.lex.cpython-310: module MAY be using inspect.getsourcefile ply.__pycache__.yacc.cpython-310: module references __file__ ply.__pycache__.yacc.cpython-310: module MAY be using inspect.getsourcefile ply.__pycache__.yacc.cpython-310: module MAY be using inspect.stack ply.__pycache__.ygen.cpython-310: module references __file__ creating /usr/local/lib/python3.10/dist-packages/ply-3.10-py3.10.egg Extracting ply-3.10-py3.10.egg to /usr/local/lib/python3.10/dist-packages Adding ply 3.10 to easy-install.pth file Installed /usr/local/lib/python3.10/dist-packages/ply-3.10-py3.10.egg Searching for networkx>=1.9.1 Reading https://pypi.org/simple/networkx/ /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release warnings.warn( Downloading https://files.pythonhosted.org/packages/b9/54/dd730b32ea14ea797530a4479b2ed46a6fb250f682a9cfb997e968bf0261/networkx-3.4.2-py3-none-any.whl#sha256=df5d4365b724cf81b8c6a7312509d0c22386097011ad1abe274a fd5e9d3bbc5f Best match: networkx 3.4.2 Processing networkx-3.4.2-py3-none-any.whl Installing networkx-3.4.2-py3-none-any.whl to /usr/local/lib/python3.10/dist-packages Adding networkx 3.4.2 to easy-install.pth file Installed /usr/local/lib/python3.10/dist-packages/networkx-3.4.2-py3.10.egg Searching for astutils>=0.0.1 Reading https://pypi.org/simple/astutils/ Downloading https://files.pythonhosted.org/packages/88/d9/86e4053d44baa2b648596a443e2bcf5b8e1d30a9669b14bfacc5307fbc2f/astutils-0.0.6.tar.gz#sha256=e9a6f31b243ecfc3c7c84dd2f145cf5de83e475b650d2a6b781cfa713ad154 27 Best match: astutils 0.0.6 Processing astutils-0.0.6.tar.gz Writing /tmp/easy_install-m_n7hv2u/astutils-0.0.6/setup.cfg Running astutils-0.0.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-m_n7hv2u/astutils-0.0.6/egg-dist-tmp-witr0wfs /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( zip_safe flag not set; analyzing archive contents... Moving astutils-0.0.6-py3.10.egg to /usr/local/lib/python3.10/dist-packages Adding astutils 0.0.6 to easy-install.pth file Installed /usr/local/lib/python3.10/dist-packages/astutils-0.0.6-py3.10.egg Searching for pyparsing>=3.0.9 Reading https://pypi.org/simple/pyparsing/ /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release warnings.warn( Downloading https://files.pythonhosted.org/packages/be/ec/2eb3cd785efd67806c46c13a17339708ddc346cbb684eade7a6e6f79536a/pyparsing-3.2.0-py3-none-any.whl#sha256=93d9577b88da0bbea8cc8334ee8b918ed014968fd2ec383e868 fb8afb1ccef84 Best match: pyparsing 3.2.0 Processing pyparsing-3.2.0-py3-none-any.whl Installing pyparsing-3.2.0-py3-none-any.whl to /usr/local/lib/python3.10/dist-packages Adding pyparsing 3.2.0 to easy-install.pth file Installed /usr/local/lib/python3.10/dist-packages/pyparsing-3.2.0-py3.10.egg Searching for setuptools==59.6.0 Best match: setuptools 59.6.0 Adding setuptools 59.6.0 to easy-install.pth file Using /usr/lib/python3/dist-packages Finished processing dependencies for dd==0.5.6 ```

... which additionally installs Cython (which I chose to be version 0.29.21 to match dd v0.5.6). So this slightly differs from what you offered.

Also, to import dd.cudd it is necessary to change to a directory other than the repository's root, for example to tests/. The reason is to import from site-packages, instead of the local directory dd. Whether the dd directory contains dd.cudd depends on how dd was built and installed. So:

python setup.py install --fetch --cudd --cudd_zdd
cd tests
python -c 'import dd.cudd'

Thanks. Well, on my setup this fails with undefined symbol: `_PyGen_Send` now:

root@u2004:~/debug/src/github.com/tulip-control/dd.git# cd tests
root@u2004:~/debug/src/github.com/tulip-control/dd.git/tests# python3 -c 'import dd.cudd'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /usr/local/lib/python3.10/dist-packages/dd-0.5.6-py3.10-linux-x86_64.egg/dd/cudd.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send

And without Cython the build fails:

root@u2004:~/debug/src/github.com/tulip-control/dd# python3 setup.py install --fetch --cudd
`import cython` failed
++ download: https://sourceforge.net/projects/cudd-mirror/files/cudd-3.0.0.tar.gz/download
-- done downloading.
++ unpack: cudd-3.0.0.tar.gz
-- done unpacking.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes

  [...]

copying dd/cudd.pyx -> build/lib.linux-x86_64-3.10/dd
copying dd/cudd_zdd.pyx -> build/lib.linux-x86_64-3.10/dd
copying dd/sylvan.pyx -> build/lib.linux-x86_64-3.10/dd
running build_ext
building 'dd.cudd' extension
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/dd
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/root/debug/src/github.com/tulip-control/dd/cudd-3.0.0/. -I/root/debug/src/github.com/tulip-control/dd/cudd-3.0.0/cudd -I/root/debug/src/github.com/tulip-control/dd/cudd-3.0.0/dddmp -I/root/debug/src/github.com/tulip-control/dd/cudd-3.0.0/epd -I/root/debug/src/github.com/tulip-control/dd/cudd-3.0.0/mtr -I/root/debug/src/github.com/tulip-control/dd/cudd-3.0.0/st -I/root/debug/src/github.com/tulip-control/dd/cudd-3.0.0/util -I/usr/include/python3.10 -c dd/cudd.c -o build/temp.linux-x86_64-3.10/dd/cudd.o -fPIC -std=c99 -DBSD -DHAVE_IEEE_754 -mtune=native -pthread -fwrapv -fno-strict-aliasing -Wall -W -O3 -DSIZEOF_LONG=8 -DSIZEOF_VOID_P=8
cc1: fatal error: dd/cudd.c: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1

Did I miss some step of traveling back to the past?

johnyf commented 3 days ago

The _PyGen_Send error is due to the combination of an early Python 3.10 version and cython == 0.29.21. I could reproduce the error using python == 3.10.1 and cython == 0.29.21.

The error is fixed when using cython == 0.29.22 and python == 3.10.1.

In addition, using Python 3.10.12+ and cython == 0.29.21, dd.cudd imports without errors.

Also, dd == 0.5.7 too supports Python 3.10 (as well as Python 3.8). The tests in dd == 0.5.7 have been updated to run using pytest, because nose does not support Python 3.10.

Using a virtual environment is recommended, for example virtualenvwrapper.