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

ModuleNotFoundError: No module named 'nebula2' #120

Closed
LHH-James opened this issue Jul 5, 2021 · 11 comments
Closed

ModuleNotFoundError: No module named 'nebula2' #120

LHH-James opened this issue Jul 5, 2021 · 11 comments

Comments

@LHH-James
Copy link

安装完成了,可是还是报错

@wey-gu
Copy link
Contributor

wey-gu commented Jul 5, 2021

安装完成了,可是还是报错

Which version did you install, please?

@LHH-James
Copy link
Author

安装完成了,可是还是报错

Which version did you install, please?

nebula-python-2.0.0

@wey-gu
Copy link
Contributor

wey-gu commented Jul 5, 2021

You should use nebula2-python instead :)

~/Downloads
❯ python3 -m venv venv0

~/Downloads
❯ source venv0/bin/activate

~/Downloads
venv0 ❯ python
Python 3.9.5 (default, May  3 2021, 19:12:05)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from nebula2.gclient.net import ConnectionPool
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'nebula2'
>>>

~/Downloads 13s
venv0 ❯ pip install nebula2-python==2.0.0
Collecting nebula2-python==2.0.0
  Using cached nebula2_python-2.0.0-py3-none-any.whl
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting httplib2
  Downloading httplib2-0.19.1-py3-none-any.whl (95 kB)
     |████████████████████████████████| 95 kB 384 kB/s
Collecting future
  Downloading future-0.18.2.tar.gz (829 kB)
     |████████████████████████████████| 829 kB 725 kB/s
Collecting pyparsing<3,>=2.4.2
  Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 5.2 MB/s
Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
Installing collected packages: pyparsing, six, httplib2, future, nebula2-python
    Running setup.py install for future ... done
Successfully installed future-0.18.2 httplib2-0.19.1 nebula2-python-2.0.0 pyparsing-2.4.7 six-1.16.0
WARNING: You are using pip version 21.1.1; however, version 21.1.3 is available.
You should consider upgrading via the '/Users/weyl/Downloads/venv0/bin/python3.9 -m pip install --upgrade pip' command.

~/Downloads 9s
venv0 ❯ pip freeze | grep nebula
nebula2-python==2.0.0

~/Downloads
venv0 ❯ python
Python 3.9.5 (default, May  3 2021, 19:12:05)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from nebula2.gclient.net import ConnectionPool
>>> from nebula2.Config import Config
>>> config = Config()
>>>

@LHH-James
Copy link
Author

You should use nebula2-python instead :)

~/Downloads
❯ python3 -m venv venv0

~/Downloads
❯ source venv0/bin/activate

~/Downloads
venv0 ❯ python
Python 3.9.5 (default, May  3 2021, 19:12:05)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from nebula2.gclient.net import ConnectionPool
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'nebula2'
>>>

~/Downloads 13s
venv0 ❯ pip install nebula2-python==2.0.0
Collecting nebula2-python==2.0.0
  Using cached nebula2_python-2.0.0-py3-none-any.whl
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting httplib2
  Downloading httplib2-0.19.1-py3-none-any.whl (95 kB)
     |████████████████████████████████| 95 kB 384 kB/s
Collecting future
  Downloading future-0.18.2.tar.gz (829 kB)
     |████████████████████████████████| 829 kB 725 kB/s
Collecting pyparsing<3,>=2.4.2
  Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 5.2 MB/s
Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
Installing collected packages: pyparsing, six, httplib2, future, nebula2-python
    Running setup.py install for future ... done
Successfully installed future-0.18.2 httplib2-0.19.1 nebula2-python-2.0.0 pyparsing-2.4.7 six-1.16.0
WARNING: You are using pip version 21.1.1; however, version 21.1.3 is available.
You should consider upgrading via the '/Users/weyl/Downloads/venv0/bin/python3.9 -m pip install --upgrade pip' command.

~/Downloads 9s
venv0 ❯ pip freeze | grep nebula
nebula2-python==2.0.0

~/Downloads
venv0 ❯ python
Python 3.9.5 (default, May  3 2021, 19:12:05)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from nebula2.gclient.net import ConnectionPool
>>> from nebula2.Config import Config
>>> config = Config()
>>>

图片

这样?

@wey-gu
Copy link
Contributor

wey-gu commented Jul 5, 2021

从 pip install 结果看您已经安装了对的版本: nebula2-python==2.0.0
请确保您的 PyCharm 的 python 环境和 pip install 的是同一个哈。

@LHH-James
Copy link
Author

从 pip install 结果看您已经安装了对的版本: nebula2-python==2.0.0
请确保您的 PyCharm 的 python 环境和 pip install 的是同一个哈。

确定一样的,可是还是不行,真叫人头大

@wey-gu
Copy link
Contributor

wey-gu commented Jul 5, 2021

从 pip install 结果看您已经安装了对的版本: nebula2-python==2.0.0
请确保您的 PyCharm 的 python 环境和 pip install 的是同一个哈。

确定一样的,可是还是不行,真叫人头大

在 restApi.py 开头加上这个代码执行看一下打印结果确认下python的环境呢?

import dis
print(dis.__file__)

我这里执行大概是

❯ python3
Python 3.9.5 (default, May  3 2021, 19:12:05)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dis
>>> dis.__file__
'/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/dis.py'

另外你有没有把 nebula2 的同名文件夹创建在哪里造成了python 优先去文件夹里找包了?

@LHH-James
Copy link
Author

从 pip install 结果看您已经安装了对的版本: nebula2-python==2.0.0
请确保您的 PyCharm 的 python 环境和 pip install 的是同一个哈。

确定一样的,可是还是不行,真叫人头大

在 restApi.py 开头加上这个代码执行看一下打印结果确认下python的环境呢?

import dis
print(dis.__file__)

我这里执行大概是

❯ python3
Python 3.9.5 (default, May  3 2021, 19:12:05)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dis
>>> dis.__file__
'/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/dis.py'

另外你有没有把 nebula2 的同名文件夹创建在哪里造成了python 优先去文件夹里找包了?

图片
检查了没有见到所说的情况发

@wey-gu
Copy link
Contributor

wey-gu commented Jul 5, 2021

好的,从您的debug看,执行环境里,python是 C:\Python37 下的。但是这还不能说明 pip的是同一个的,您能在命令行里执行一下pip看看么?

C:\Python37\bin\python -m pip install nebula2-python==2.0.0

update: sorry,从您的截图看,pip也是安装到了那个目录,很奇怪,test.py同级的文件有哪些呢?没有 nebula2 之类的吧?

cd D:/PycharmProjects/neb2/
dir

@LHH-James
Copy link
Author

好的,从您的debug看,执行环境里,python是 C:\Python37 下的。但是这还不能说明 pip的是同一个的,您能在命令行里执行一下pip看看么?

C:\Python37\bin\python -m pip install nebula2-python==2.0.0

update: sorry,从您的截图看,pip也是安装到了那个目录,很奇怪。

![Uploading 图片.png…]

ok 了。貌似平时执行是要python pip install xxxx.。 而我当时安装时候时pip install xxxx。刚才试了一下您发的这句,就可以了

@wey-gu
Copy link
Contributor

wey-gu commented Jul 5, 2021

好的,关了哈。

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