I am using Python 3.6.4 , and pip 18.0. I have successfully installed numpy and pywin32 with pip, however when I try to import them in a file using notepad like so:
import numpy
import win32com.client
I get these errors when running the file:
Traceback (most recent call last):
File "C:\Users\Joshua\Desktop\Python\test.py", line 1, in <module>
import pandas
File "C:\Program Files\Python36\Lib\site-packages\pandas\__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
Or
Traceback (most recent call last):
File "C:\Users\Joshua\Desktop\Python\test.py", line 1, in <module>
import win32com.client
File "C:\Program Files\Python36\Lib\site-packages\win32com\__init__.py", line 5, in <module>
import win32api, sys, os
ImportError: No module named win32api
However the confusing and frustrating thing is if I try to import these modules directly in the python interpreter like:
python.exe
>>> import numpy
>>> import win32com.client
There is no error and I can use all of the classes and functions of these modules.
All of these modules are located in the site-packages directory which is referenced in my Path and PYTHONPATH environment variables:
PYTHONPATH=C:\Program Files\Python36\Scripts;C:\Program Files\Python36;C:\Program Files\Python36\Lib\site-packages;
Path=C:\Program Files\Python36\Scripts;C:\Program Files\Python36;C:\Program Files\Python36\Lib\site-packages
And I can confirm that the site-packages directory is listed in the sys.path property:
>>> import sys
>>> print("\n".join(sys.path))
C:\Program Files\Python36\Scripts
C:\Program Files\Python36
C:\Program Files\Python36\Lib\site-packages
C:\Users\Joshua\Desktop\Python
C:\Program Files\Python36\python36.zip
C:\Program Files\Python36\DLLs
C:\Program Files\Python36\lib
C:\Program Files\Python36\lib\site-packages\win32
C:\Program Files\Python36\lib\site-packages\win32\lib
C:\Program Files\Python36\lib\site-packages\Pythonwin
>>>
I am at a loss for what is wrong...