0

Running on Windows 10, I have Python 3.7.3 installed to my c/users/myUser/appdata/local/programs folder. When I use PIP to install a package, it seems to run fine, but when I use "import package" in python it doesn't recognize that package. What would cause this?

Running 'python --version' works and also running 'pip --version' works.

PIP shows up in my c/users/myUser/appdata/local/programs/python37-32/lib/site-packages/pip folder.

UPDATE: So I was looking through files to determine where the libraries are located that do work with my python. The folder is located in Python/Python37-32/Lib. All of those currently work when importing. However when I do anything with PIP it does not add anything to that folder. I noticed there are a couple different PIP executables within Python/Python37-32/Scripts which include pip.exe, pip3.exe, and pip3.7.exe. I tried using "pip3.7 install numpy" which also did not work. I noticed when trying to add an existing package its pointing to the Python37-32/lib/site-packages folder.

JoshKunz
  • 55
  • 1
  • 10
  • your question may lack info ... windows, linux os macos ? are you using pipenv, virtualenv, ... ? can't answer – Carlos Leite Aug 12 '20 at 14:05
  • Make sure that the pip version you use matches the python version that you run, and that you didn't install the module in one virtualenv and tried to execute it from another. – Or Y Aug 12 '20 at 14:07

1 Answers1

2

SOLUTION:

I removed python from my machine, and reinstalled it. I had the same problem. What I done to fix this was to use PS python -m pip install --user package

Also I appended my PATH environment variable with cmd setx path "%path%;C:\Users\MyUser\AppData\Roaming\Python\Python38\Scripts"

That seemed to have taken care of my issue. Now when I install a package with PIP I can reference it through python.

JoshKunz
  • 55
  • 1
  • 10