Pip "Ignoring invalid distribution" warning [duplicate] - python

This question already has answers here:
pip how to remove incorrectly installed package with a leading dash: "-pkgname"
(4 answers)
Closed 1 year ago.
For the past few pip package/module installs I have been performing in Windows 10 Command prompt, I am seeing warnings during the installation stating:
WARNING: Ignoring invalid distribution -jango (c:\users\myusername\appdata\roaming\python\python37\site-packages)
Background system info:
Python version 3.7
Pip version 21.1.1
What is the issue here, and how can I fix this? I looked into some other posts that faced similar issues, but was not able to find any good answers on how to solve it.

Not sure how you would have gotten the django folder, only you can answer that! I'm assuming you mean "django" here not "jango" as "jango" isn't a package.
However if you delete the folder
c:\users\myusername\appdata\roaming\python\python37\site-packages\django (or jango, either one)
then this error will go away when using pip. You can then reinstall it again with pip if you decide that you need it. Obviously make sure nothing is in that folder that you've changed before you do this.
Another thing you could try is renaming the "jango" folder to "django" if it is indeed listed as "jango", perhaps the first letter was removed from the folder name by accident and this is now confusing pip.

Related

Pip Fatal Error in launcher: Unable to create process when using ""

I already fixed this, but I will post the question anyways and answer it so if there are other people having this issue they may find this.
I installed blender a while ago and did some stuff using python. I can't recall what exactly I did, it was for a school project. However, when I recently tried to use pip to install something I got the following message:
Error in launcher: Unable to create process when using "path to python my blender folder"
Even if you get this answer due to another situation my solution might still help you.
This worked for me:
First I uninstalled Blender.
Then I uninstalled python and reinstalled the newest version.
I deleted every environment variable path I could find leading to an old python version.
In the Terminal I entered where pip and still got some paths leading to old python versions, I went to these locations and deleted every folder labeled with an old python version, in my case these locations were C:\Python37and C:\Users\myusername\Appdata\Roaming\Python
And that's it. After that pip worked as it should.

python module not found even though it is installed [duplicate]

This question already has answers here:
PyCharm error: 'No Module' when trying to import own module (python script)
(17 answers)
Closed 1 year ago.
I am using PyCharm and am having trouble importing modules
I set up a venv and imported the dependencies via pip install -r
When I try to run the application and get 'module not found' for all imports.
If I open a terminal in PyCharm and do pip list all the required modules are listed
Further PyCharm can file the modules - I can perform completion when typing the name of the module.
What else can I try?
Sounds like you have more than one python environment on your machine.
So, in my opinion, you need to manage the environments in python IDE.
The same happened to me so this helped me in that.
Do check: https://docs.python.org/3/tutorial/venv.html
You can also seek help from the below article:
https://www.freecodecamp.org/news/manage-multiple-python-versions-and-virtual-environments-venv-pyenv-pyvenv-a29fb00c296f/
I solved this by checking the boxes 'Add content toots to PYTONPATH' and #Add source roots to PYTHONPATH'

Installing numpy? [duplicate]

This question already has answers here:
'pip' is not recognized as an internal or external command
(40 answers)
Closed 2 years ago.
I am a new python user. I downloaded python and VS code and ran a few scripts such as print statements and for loops, and everything seems to be working alright.
However, I want to be able to use packages such as numpy. The way that I understand it, I am supposed to go to my computer's command line and type something in such as "pip install numpy," to get numpy installed. However, I have tried typing in many variations of this phrase into my command line, such as "pip3 install numpy", "python install numpy", and things of this nature. No matter what I type in, I get the message "_____ is not recognized as an internal or external command, operable program or batch file."
I am having trouble even getting my command line to recognize that I have python set up and downloaded... and yet, I can clearly access python in VS code as well as on my computer in general. One possible problem is maybe I am in the wrong directory? But I do not know how to find this out of change to the correct directory. Can someone please tell me what to type in or what I am doing wrong? I am on a windows 64 bit computer.
Thank you so much! :)
There is two step for installing python in windows. If you want to user python in your command line, you have to set a PATH. These can help you:
1- https://geek-university.com/python/add-python-to-the-windows-path/
2- How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
After set PATh, you can use python in your command line. Then you should install pip tool. This link gives you a hand to do that:
1- https://phoenixnap.com/kb/install-pip-windows
After installing python and pip, i recommend you to google about virtualenv. It's a wide used tool for python programming.
Normally you dont need to install numpy. Just use in your code:
import numpy as np
Run the script. If you dont see any errors it is because you already had it.

Spyder cannot find module named 'pandas_datareader'

First off I would like to say that I am aware that this question has been asked before, however, none of the other posts have offered a solution that resolves the problem.
I am trying to use pandas-datareader to grab stock prices from the internet. I am using windows with python version 3.6. I first installed pandas-datareader from the console using
pip install pandas-datareader.
I then wrote a code which used the line
import pandas_datareader.data as web
It came back with the error
`ModuleNotFoundError: No module named 'pandas_datareader'
I tried to redownload pandas-datareader, just in case it didn't work the first time, but the console came back with "Requirement already satisfied" so that wasn't the problem.
From there I uninstalled pandas-datareader, and reinstalled it with
pip3 install pandas-datareader
I still got the same error message.
I was worried that it might have something to do with old versions of python installed on my computer so I deleted all files for python 2.7, but this did not help the issue. I restarted spyder and my computer and this did not help. I tried Jupiter notebook and this did not help either.
Now to take my investigation one step further, I looked in my file folders at the hidden files to see where pandas-datareader could be hiding. When I go to C:\Users\J.Shepard\Anaconda3\pkgs and C:\Users\J.Shepard\Anaconda3\pkgs I see that pandas-0.23.0-py36h830ac7b_0 is installed but I cannot find anything that looks like pandas-datareader. In fact, when I search for "pandas-datareader" in my file search, I only see 2 text files with one line of code each. I do not know what to make of this discovery but I thought it might be helpful to someone else.
I hope that I have made a good case to prove that I have genuinely tried and failed to solve this problem on my own. Based on the number of other unresolved posts related to this same question, I believe that this is a question that deserves to be asked again.
I tried conda install pandas-datareader in Anaconda Prompt. It was installed and after my computer restarted, pandas-datareader worked in spyder 3.6.

Install error easy_install python [duplicate]

This question already has answers here:
python3 --version shows "NameError: name 'python3' is not defined"
(2 answers)
Closed 6 years ago.
I use Windows 7 and Python IDLE.
I'm trying to use easy_install but gut this error:
Traceback (most recent call last): File "", line 1, in
easy_install NameError: name 'easy_install' is not defined
In included in my 'Path' the directory where it has been installed (C:\Python27\Scripts).
Any thoughts on what could be wrong?
Maybe...
In Python IDLE > File > Path browser, I cannot see C:\Python27\Scripts. How to add it ?
Make sure you've done all of this.
Adding Python to Windows Path.
Downloading and installing setuptools for appropriate python version.
Adding Scripts directory (for instance C:\Python27\Scripts) to Windows Path.
You can check installing by opening a command prompt and typing "easy_install"
easy_install is an executable program, not a Python script. Run it from the Windows command line, not from Python.
I once had a similar problem when I was trying to use easy_install. I finally was able to install both easy_install and pip although I really needed just one of them to get the job done.
If you are still struggling with this problem, I would suggest you follow these instructions I put together recently for others who asked me to. It is fairly easy to follow in order to re-install easy_install on your machine. I also explain how to add the directory to your path - which sounds like you have done already but still seeing the above problem. Here is the link that might help you solve this problem.
Simple easy_install installation guide for windows
I hope this helps you get back up and running again! Good luck!

Categories

Resources