简体   繁体   English

python 询问我安装的模块

[英]python asking me for installed modules

I'm trying to use a python 3 script that requires the "neo4j" module.我正在尝试使用需要“neo4j”模块的 python 3 脚本。 I already installed the module in python 3, but when try to run the script again, it keeps asking for the module.我已经在 python 3 中安装了该模块,但是当再次尝试运行该脚本时,它一直在询问该模块。

When try to run the program that requires neo4j module:当尝试运行需要 neo4j 模块的程序时:

c:\Users\user1\Downloads\PlumHound-master>python3 PlumHound.py -h
Traceback (most recent call last):
  File "PlumHound.py", line 12, in <module>
    import lib.phTasks
  File "c:\Users\user1\Downloads\PlumHound-master\lib\phTasks.py", line 12, in <module>
    from neo4j import GraphDatabase
ModuleNotFoundError: No module named 'neo4j'

When I try to install the module:当我尝试安装模块时:

c:\Users\user1\Downloads\PlumHound-master>python3 -m pip install neo4j
Requirement already satisfied: neo4j in c:\users\user1\downloads\plumhound-master (4.2.1)
Requirement already satisfied: pytz in c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages (from neo4j) (2021.1)

Does anyone know or have an idea about why this might be happening, and how I can fix it?有谁知道或知道为什么会发生这种情况,以及我该如何解决? PD: The device is offline and i installed the module manually with pip. PD:设备离线,我用 pip 手动安装了模块。

If you're on Windows you can try running the following如果您在 Windows 上,您可以尝试运行以下命令

python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"

then cd to the output of the last command然后 cd 到最后一条命令的 output

dir

look for the neoj4 package and the corresponding version找neoj4 package和对应版本

cd neo4j-1.x.x/

and finally run最后运行

python3 setup.py install

If you're a unix based platform try running this.如果您是基于 unix 的平台,请尝试运行此。

$ which python3
~/anaconda3/bin/python3
$ ls
Anaconda3-2018.12-Linux-x86_64.sh  anaconda3  neo4j-1.7.2  neo4j-1.7.2.tar.gz
$ cd neo4j-1.7.2/
$ python3 setup.py install

Also try pip installing neobolt也尝试安装neobolt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM