Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'library_path' #454

Open
learnerLj opened this issue Dec 21, 2022 · 3 comments · May be fixed by #455
Open

No module named 'library_path' #454

learnerLj opened this issue Dec 21, 2022 · 3 comments · May be fixed by #455

Comments

@learnerLj
Copy link

I followed the instruction in README and built stp on Ubuntu 22.04 LTS on VMware. I encounter the same problem #446 and addressed it with the advice #446 (comment) . Finally, the installation is successful.

[100%] Built target stp_simple-bin
-- Install configuration: "RelWithDebInfo"
-- Up-to-date: /usr/local/lib/cmake/STP/STPConfig.cmake
-- Up-to-date: /usr/local/lib/cmake/STP/STPConfigVersion.cmake
-- Up-to-date: /usr/local/lib/cmake/STP/STPTargets.cmake
-- Up-to-date: /usr/local/lib/cmake/STP/STPTargets-relwithdebinfo.cmake
-- Installing: /usr/local/lib/libstp.so.2.3
-- Set runtime path of "/usr/local/lib/libstp.so.2.3" to "lib"
-- Installing: /usr/local/lib/libstp.so
-- Installing: /usr/local/include/stp/c_interface.h
-- Installing: /usr/local/bin/stp
-- Set runtime path of "/usr/local/bin/stp" to "lib"
-- Installing: /usr/local/bin/stp_simple
-- Set runtime path of "/usr/local/bin/stp_simple" to "lib"
-- Installing: /home/learner/tools/anaconda3/lib/python3.9/site-packages/stp/stp.py
-- Installing: /home/learner/tools/anaconda3/lib/python3.9/site-packages/stp/__init__.py
-- Installing: /home/learner/tools/anaconda3/lib/python3.9/site-packages/stp/library_path.py

However, it throws an error when I import stp in python. the error shows that

(base) ➜  build git:(master) ✗ python
Python 3.9.13 (main, Aug 25 2022, 23:26:10)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import stp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/learner/tools/anaconda3/lib/python3.9/site-packages/stp/__init__.py", line 26, in <module>
    from .stp import (
  File "/home/learner/tools/anaconda3/lib/python3.9/site-packages/stp/stp.py", line 45, in <module>
    from library_path import PATHS
ModuleNotFoundError: No module named 'library_path'

I do not find any package named library_path at PyPI or conda.

@rgov
Copy link
Member

rgov commented Dec 21, 2022

If you edit /home/learner/tools/anaconda3/lib/python3.9/site-packages/stp/stp.py to change line 45 to

from .library_path import PATHS

does it have the same issue?

@learnerLj
Copy link
Author

If you edit /home/learner/tools/anaconda3/lib/python3.9/site-packages/stp/stp.py to change line 45 to

from .library_path import PATHS

does it have the same issue?

Thanks! It works.

@rgov rgov linked a pull request Dec 21, 2022 that will close this issue
@SJTUwwz
Copy link

SJTUwwz commented Sep 19, 2023

Hello!I try to edit the line 45 in stp.py, but I meet another error unfortunely.

import stp
Traceback (most recent call last):
File "", line 1, in
File "/home/anaconda3/lib/python3.9/site-packages/stp/stp.py", line 45, in
from .library_path import PATHS
ImportError: attempted relative import with no known parent package

Could you please help me figure it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants