python-3.x - pip install 出错:“没有名为 pip.__main__ 的模块”
问题描述
在我的电脑(Windows 8.1)上有 python 3.4。当我尝试pip install
使用我使用的代码安装模块时:
py -m pip install ...
但是命令行返回以下错误:
C:\Python34\python.exe: No module named pip.__main__; 'pip' is a package and cannot be directly exec
uted
解决方案
Pip 不是一个独立的可执行文件。它是一个python模块。所以事实上你可以做到这一点(用numpy测试,按要求正常工作):
python -m pip install numpy
好吧,您应该看到有关Python的文档。我确实提到 Pip 是一个独立的可执行文件。如果它在你的路径中,那么你也可以这样做:
pip install numpy
确保 python 在你的路径中。
推荐阅读
- ruby-on-rails - Mongo::Error::SocketError:在 mongo 副本集中执行查询时管道损坏
- laravel - Laravel 多重身份验证来自两个不同的路由和视图
- pine-script - 今天第五分钟关门
- android - 未显示所有数据,但带有 RecyclerView 的 AdMobs
- python - Processing.py 中的“动画”运动
- node.js - 如何使用 nodejs 在云 Firestore 中检索用户身份验证信息?
- datepicker - vuetify v-date-picker 在波斯语环境中不是从每月的第一天开始
- ios - 覆盖结构中的 Codable 实现
- pine-script - 松纸逻辑混乱
- python - 如何从单独的进程(例如,编辑器、vim)在 Jupyter Notebook 服务器中创建和执行单元?