Some pip installs don't work on a computer, since recently I changed to Python 3.
for example, pywinauto
I used 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
It shows:
pywinauto==0.6.8
But when I:
import pywinauto
It gives:
ModuleNotFoundError: No module named 'pywinauto'
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\
To:
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts\
And:
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 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
Environment Variables > System variables
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
ps I have Anaconda installed in the machine, and no Python 2. Not sure whether it causes the problem.
Seems the problem relates to Anaconda.
Problem solved by run CMD:
C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts>pip instsall pywinauto
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\
To:
C:\Users\NAME\AppData\Local\Continuum\anaconda3
The package functions normally.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.