You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.
git clone https://github.com/nanomsg/nnpy.git
cd nnpy/nnpy
python tests.py
This produces the output::
Traceback (most recent call last):
File "tests.py", line 2, in <module>
import filecmp, nnpy, sys, unittest
File "build/bdist.linux-x86_64/egg/nnpy/__init__.py", line 2, in <module>
from _nnpy import ffi, lib as nanomsg
File "build/bdist.linux-x86_64/egg/_nnpy.py", line 7, in <module>
File "build/bdist.linux-x86_64/egg/_nnpy.py", line 3, in __bootstrap__
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/usr/lib/python2.7/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser
File "/usr/lib/python2.7/email/feedparser.py", line 27, in <module>
from email import message
File "/usr/lib/python2.7/email/message.py", line 16, in <module>
import email.charset
File "/usr/lib/python2.7/email/charset.py", line 13, in <module>
import email.base64mime
File "/usr/lib/python2.7/email/base64mime.py", line 40, in <module>
from email.utils import fix_eols
File "/usr/lib/python2.7/email/utils.py", line 28, in <module>
import socket
File "/home/nnpy/nnpy/socket.py", line 1, in <module>
from . import errors, ffi, nanomsg
ValueError: Attempted relative import in non-package
This is because the directory that the tests are being run in takes precedence for imports and class declarations. This can be observed in the lines:
...
File "/usr/lib/python2.7/email/utils.py", line 28, in <module>
import socket
...
There are three options:
Move test,py to nnpy/
Create an nnpy/test/ directory and move it there
Create an nnpy/nnpy/test/ directory and move it there
I think option 3 is preferable
The text was updated successfully, but these errors were encountered:
OS: Kubuntu 20.04
To recreate:
This produces the output::
This is because the directory that the tests are being run in takes precedence for imports and class declarations. This can be observed in the lines:
There are three options:
test,py
to nnpy/nnpy/test/
directory and move it therennpy/nnpy/test/
directory and move it thereI think option 3 is preferable
The text was updated successfully, but these errors were encountered: