为python包添加路径

2024-04-29 14:10:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经使用pip install tavern安装了一个python包,即tavern,安装后它没有将包添加到路径中,我在shell中键入tavern后手动将其添加到路径中,我以err{}结束

因此,我尝试使用以下命令设置路径:

1-open .bash_profile

2-alias tavern="/Users/divyanshurawat/Library/Python/2.7/lib/python/site-packages/tavern"

3-source ~/.bash_profile

但是即使你写sudo tavern,它似乎仍然不起作用,我不知道这里缺少什么,也许我设置路径的方法是错误的

这就是酒馆目录的样子

__init__.py,
_plugins,
core.pyc,
entry.pyc,
plugins.pyc,
response,
testutils,
__init__.pyc,
core.py,
entry.py,
plugins.py,
request,
schemas,
util

Tags: installpippycore路径bash键入init