pip install -e安装的可编辑包无法被Python识别,版本不符求助
问题:可编辑模式安装的Python包无法被正常解析
此前一切正常,但自2022年12月起,以可编辑模式安装的软件包无法再被Python正常解析。
复现步骤
在终端执行以下命令:
git clone git@github.com:pydata/numexpr.git pip install -e --user numexpr
本地目录结构如下:
.local/ └── lib/ └── python3.8/ └── site-packages/ ├── numexpr-2.8.5.dev1.dist-info/ ├── __editable___numexpr_2_8_5_dev1_finder.py └── __editable___numexpr_2_8_5_dev1_finder.py
在Python Notebook中执行以下代码:
import numexpr numexpr.__version__
异常现象
执行上述代码后返回版本为2.7.1,并非通过可编辑模式安装的2.8.5.dev1版本;但在终端执行pip show numexpr显示的是正确版本2.8.5.dev1。
疑问
为何Python无法识别该库?是否与site-packages目录中不存在numexpr/文件夹有关?
环境信息
- Python:3.8
- pip:22.3.1
内容的提问来源于stack exchange,提问作者Pierrick Rambaud
相关产品推荐
相关产品推荐

