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

Issue with offline installation: importing gives syntax error #12

Open
haykp opened this issue Aug 5, 2021 · 5 comments
Open

Issue with offline installation: importing gives syntax error #12

haykp opened this issue Aug 5, 2021 · 5 comments

Comments

@haykp
Copy link

haykp commented Aug 5, 2021

We were able to download package and install offline mode.
When doing pip3 list it shows that cocotb-pcie is installed:

**/Python-3.9.6/bin/pip3 list
Package        Version
-------------- ----------
cocotb         1.6.0.dev0
cocotb-bus     0.0.0
cocotbext-axi  0.1.13
cocotbext-pcie 0.1.15
electrical     1.0.0
more-itertools 8.8.0
pip            21.1.3
setuptools     56.0.0
simulator      1.0.3
version        0.1.2

However when importing in python, it gives strange error:

python3
Python 3.9.6 (default, Aug  5 2021, 10:07:49) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cocotbext-pcie
  File "<stdin>", line 1
    import cocotbext-pcie
                    ^
SyntaxError: invalid syntax

Any ideas what is this?

@alexforencich
Copy link
Owner

alexforencich commented Aug 5, 2021

It's a namespace package. Import it as cocotbext.pcie.

@haykp
Copy link
Author

haykp commented Aug 5, 2021

Same error is there:

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

@alexforencich
Copy link
Owner

That's not the same error, it's no longer a syntax error. Looks like you don't actually have the package installed. Do you possibly have multiple python installations?

@haykp
Copy link
Author

haykp commented Aug 5, 2021

actually no, so strange.
The package installation passed good

Installed /user/t2068243/petro/Python-3.9.6/lib/python3.9/site-packages/cocotbext_pcie-0.1.15-py3.9.egg
Processing dependencies for cocotbext-pcie==0.1.15
Searching for cocotbext-axi==0.1.13
Best match: cocotbext-axi 0.1.13
Processing cocotbext_axi-0.1.13-py3.9.egg
cocotbext-axi 0.1.13 is already the active version in easy-install.pth

Using /user/t2068243/petro/Python-3.9.6/lib/python3.9/site-packages/cocotbext_axi-0.1.13-py3.9.egg
Searching for cocotb==1.6.0.dev0
Best match: cocotb 1.6.0.dev0
Processing cocotb-1.6.0.dev0-py3.9-linux-x86_64.egg
cocotb 1.6.0.dev0 is already the active version in easy-install.pth
Installing cocotb-config script to /user/t2068243/petro/Python-3.9.6/bin

Using /user/t2068243/petro/Python-3.9.6/lib/python3.9/site-packages/cocotb-1.6.0.dev0-py3.9-linux-x86_64.egg
Searching for cocotb-bus==0.0.0
Best match: cocotb-bus 0.0.0
Processing cocotb_bus-0.0.0-py3.9.egg
cocotb-bus 0.0.0 is already the active version in easy-install.pth

Using /user/t2068243/petro/Python-3.9.6/lib/python3.9/site-packages/cocotb_bus-0.0.0-py3.9.egg
Finished processing dependencies for cocotbext-pcie==0.1.15

@alexforencich
Copy link
Owner

well, in that case I have no idea what the issue is. You should be able to import that, though:

$ python
Python 3.9.6 (default, Jun 30 2021, 10:22:16) 
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cocotbext.pcie
>>> 

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

No branches or pull requests

2 participants