1

I've created a new Django project since almost 1 month ago. I have several packages installed. As I'm using virtual environment I can find all these packages in this directory F:\newEnironment\Lib\site-packages enter image description here

Now when I activate my environment and go on my project, pip command doesn't do anything. I want to use pip lists and pip freeze. Both returns nothing.

Some of the project abilities won't work if these packages aren't installed. I can successfully run the project on my machine and that's why I'm quite sure this packages are installed. For instance when I write pip list in CMD it shows me that pillow isn't installed globally on my machine. As you see in the picture above it includes in site-packages directory which means I have it installed locally. Not only that, my projects pictures are works correctly because of pillow.

Ramin
  • 21
  • 5

2 Answers2

1

We don't need to deal with all issues; we can simply ignore them. I found out that this problem occurs only on this specific environment. I perform all my projects inside Virtual environment. All my past projects work well, and for them all pip commands are appliable.

So, I just decided create a new environment and move my projects into it. I managed to run pip commands inside this new environment though, I had to install all my packages again. I've not figured out what could have caused this issue yet.

Ramin
  • 21
  • 5
0

Try using pip freeze instead of pip list from within the venv to show the full list of installed packages. Also, ensure you always install packages from inside the environment (from both cmd and your IDE)

  • 1
    As I've explained all pip commands doesn't return anything include pip freeze – Ramin Apr 20 '23 at 15:45
  • is `pip` recognized as command? are you inside the virtual environment when executing `pip freeze`? – Marco Frag Delle Monache Apr 20 '23 at 15:47
  • 1
    Yeah, I'm inside virtual environment and when I type pip it returns me all pip commands but none works – Ramin Apr 20 '23 at 15:49
  • Try [this](https://stackoverflow.com/a/45309460/11961036)! It will show the path where a library is installed. Try for example `pip show pillow` from both inside and outside the `venv` – Marco Frag Delle Monache Apr 20 '23 at 15:52
  • are you activating your `venv` like so? `.\newEnironment\Scripts\activate` – Marco Frag Delle Monache Apr 20 '23 at 15:54
  • 1
    Performing this command globally returns me: WARNING: Package(s) not found: whitenoise but in my environment it returns the following text: Name: Pillow Version: 9.5.0 Summary: Python Imaging Library (Fork) Home-page: https://python-pillow.org Author: Jeffrey A. Clark (Alex) Author-email: aclark@aclark.net License: HPND Location: f:\developers\newenironment\lib\site-packages – Ramin Apr 20 '23 at 15:56
  • @Ramin i see. so basically the library looks installed but when doing `pip freeze` / `pip list` it is not listed. If you need to install `pillow` globally, then you have to launch `pip install` from outside the environment, and then it will be installed in `appdata/local`. I can safely say it's very strange. Try launching the command `pip list -v`. it will show the list of all packages with all the installation paths – Marco Frag Delle Monache Apr 21 '23 at 07:54