问题描述
某些pip安装在计算机上不起作用,因为最近我更改为Python 3.
Some pip installs don't work on a computer, since recently I changed to Python 3.
例如pywinauto
for example, pywinauto
我使用了CMD:
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts>pip install pywinauto
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts>pip freeze
它显示:
pywinauto==0.6.8
但是当我:
import pywinauto
它给出:
ModuleNotFoundError: No module named 'pywinauto'
我从以下位置移动了两个文件夹"pywinauto"和"pywinauto-0.6.8.dist-info":
I moved the 2 folders "pywinauto" and "pywinauto-0.6.8.dist-info" from:
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\
收件人:
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts\
并且:
import sys
sys.path.append('C:\\Users\\NAME\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\')
它仍然不起作用.(适用于其他情况)
It still doesn't work. (it works for some other cases)
Windows 64设置似乎可以使用:环境变量>用户变量
Windows 64 settings seem ok with: Environment Variables > User variables
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts\
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
环境变量>系统变量
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Lib\
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
p.s.我在计算机上安装了Anaconda,没有安装Python2.不确定是否会引起问题.
p.s. I have Anaconda installed in the machine, and no Python 2. Not sure whether it causes the problem.
推荐答案
问题似乎与Anaconda有关.
Seems the problem relates to Anaconda.
通过运行CMD解决的问题:
Problem solved by run CMD:
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts>pip instsall pywinauto
然后从以下位置手动移动2个文件夹"pywinauto"和"pywinauto-0.6.8.dist-info":
Then manually moved the 2 folders "pywinauto" and "pywinauto-0.6.8.dist-info" from:
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\
收件人:
C:\Users\NAME\AppData\Local\Continuum\anaconda3
该程序包正常运行.
这篇关于PIP安装程序包,但未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!