当我使用 anaconda 创建一个名为 tf-py36 的虚拟环境并激活它时,通过使用
python test.py
它警告我没有权限。但是当我使用
sudo python test.py
它使用我系统中的python版本,而不是虚拟环境中的版本。
我该如何解决这个问题?谢谢!
小智 5
发生这种情况是因为$PATH您的用户和 root 之间的用户不同。
为了使用 anaconda 版本的 python,请输入以下命令:
sudo env "PATH=$PATH" python <enter python command>
| 归档时间: |
|
| 查看次数: |
2946 次 |
| 最近记录: |