这看起来是个愚蠢的问题,但是……我想不出来。
我可以像这样在python2中运行程序:
python run.py我可以用以下命令在python3中运行程序:
python3 run.py然而,
pip install pandas将为Python2安装pandas。
如何为Python3安装它?
我试过了-
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py这将安装pip,但是当我尝试为项目安装一些需求时,我得到了错误:
You are using pip version 9.0.3, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.使用以下命令进行升级:
python3 -m pip install --upgrade pip结果如下:
Requirement already up-to-date: pip in /usr/lib/python3.6/site-packages (19.0.3)谢谢。
发布于 2019-03-07 21:11:21
作为
$ ls -1 /usr/bin/pip*
/usr/bin/pip2
/usr/bin/pip2.7
/usr/bin/pip3
/usr/bin/pip3.6你应该跑
pip3 install pandas发布于 2019-03-07 21:55:47
在你的CMD中写道:
where pip然后:
where pip3我相信,在python\sctip\中找到它的路径的pip3是您需要使用的;它是pip的Python3版本
所以你可以试试:
pip3 install pandas发布于 2019-03-09 14:10:55
您可以始终将pip作为模块运行:
python2 -m pip <pip commands here>
python3 -m pip <pip commands here>
python3.6 -m pip <pip commands here> # same as python3 as of this post
python3.7 -m pip <pip commands here>https://stackoverflow.com/questions/55044474
复制相似问题