ModuleNotFoundError: No module named 'pysot' #8
-
你好,我进入pysot的虚拟环境之后,运行你的tools/test.py的时候,出现了: Traceback (most recent call last): 我按照你的教程INSTALL.md进行了相关依赖包的安装。我设置了: README中说的:export PYTHONPATH=/path/to/PySOT:$PYTHONPATH 是什么意思呢,/path/to/PySOT具体指的哪个路径?是anaconda里面的pysot虚拟环境路径还是git clone下来的工程里面的pysot路径? |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
你好,/path/to/PySOT指的是你clone的PySOT代码路径。例如我在
即可。 PS:这个目录下还会有一个叫做pysot的文件夹,这也就是 |
Beta Was this translation helpful? Give feedback.
-
@linkinpark213 不好意思,我按照你说的执行了,还是报同样的错误。我发现只有把你说的pysot模块放到/usr/local/lib/python3.7/lib/python3.7/site-packages 执行才不会报缺少pysot模块的错误。 而且我在conda的base环境下,python之后import torch没错,但是进入conda activate pysot虚拟环境之后就报No module named 'torch'的错误。 |
Beta Was this translation helpful? Give feedback.
-
如果你是按照INSTALL.md执行的,那么可能是在 |
Beta Was this translation helpful? Give feedback.
-
@linkinpark213 是不是不需要安装python3.7,只需要安装python3.7版本的anaconda就可以了 |
Beta Was this translation helpful? Give feedback.
-
@TeslaHua 是的,Python3.7版本的Anaconda在base环境下默认使用自带的Python3.7,但是它同样可以用来创建使用其他版本Python的环境。因此,在创建环境( |
Beta Was this translation helpful? Give feedback.
-
@linkinpark213 好的,谢谢你。可能是版本冲突了,我重新弄一下。 |
Beta Was this translation helpful? Give feedback.
-
@linkinpark213 不好意思,我重新打开了这个问题。昨天我重新在pysot的虚拟环境下安装了其他依赖库,下面是我在pysot环境下的conda list,该装的依赖应该都装了:
echo $PYTHONPATH 输出: 我执行tools下的test.py时(没有加sudo),报错: 之后我加了sudo 之后也把后面的python命令变成了anaconda3/envs/pysot/bin/python3.7。 发现还是报错:
|
Beta Was this translation helpful? Give feedback.
-
我自己解决了,我看到test.py和eval.py只需要toolkit和pysot两个依赖包,我直接把它俩放到了~/anaconda3/envs/pysot/lib/python3.7/site-packages/里面可以直接运行了。 |
Beta Was this translation helpful? Give feedback.
-
python torch.distributed.launch --nproc_per_node=1 --master_port=2333 ../../tools/train.py --cfg config.yaml No module named 'pysot' |
Beta Was this translation helpful? Give feedback.
-
解决了!!!非常感激你! |
Beta Was this translation helpful? Give feedback.
-
If you use windows, you can replace "export PYTHONPATH=/path/to/PySOT:$PYTHONPATH" with the following code adding into your files. import sys It can also solve the issue: No module named 'pysot' |
Beta Was this translation helpful? Give feedback.
你好,/path/to/PySOT指的是你clone的PySOT代码路径。例如我在
/home/linkinpark213/Source
使用git clone [email protected]:STVIR/pysot.git
命令下载代码,则/home/linkinpark213/Source/pysot
即为我的/path/to/PySOT
路径。执行即可。
PS:这个目录下还会有一个叫做pysot的文件夹,这也就是
ModuleNotFoundError: No module named 'pysot'
中的pysot
模块。