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!
Related
This question already has answers here:
How do I use installed packages in PyCharm?
(14 answers)
Closed 1 year ago.
When i run the code it says:
Traceback (most recent call last):
File "C:\Users\Gebruiker\PycharmProjects\pythonProject\DiscordBot.py", line 1, in
import discord
ModuleNotFoundError: No module named 'discord'
idk how to fix this, please help me.
You can install discord using:
pip install discord
If you are using anaconda, check your python interpreter from PyCharm. Go to File->Settings->Project Settings->Project Interpreter->Python Interpreters
Ensure to select correct version of python.exe
e.g.
For bare python (For this you need to install discord ) C:\Users\xxx\AppData\Local\Programs\Python\Python38\Lib
(a path similar to this)
For anaconda you'll see C:\Users\xxx\AppData\Local\Continuum\anaconda3\python.exe
Select the correct interpreter and you are good to go
In any case, i suggest you to take the time and learn about virtual environment
https://docs.python.org/3/library/venv.html
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.
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'
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.
im trying to install tensorflow on my computer. I have windows 10. Im doing CPU only pip install. When i paste this (pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl) command into my command prompt i get error message that says "no perl script found in input". What is the problem? is it referring to Perl programming language or something else? how is perl related to any of this? Thanks!!!
what python version installed in your environment ?
if it's 3.6 you can simply replace the -cp35-cp35m- become -cp36-cp36m-
I hope it'll help
I just ran into the "No Perl script found in input" error myself, in a different situation (as is, not trying to use pip).
The original poster has supplied a comment that answers the question he asked; he had two "pip"s in his path and the wrong one was before the right one. He either had to change the order of his path or supply a full pathname.
This helped me solve my problem; I was using the command line lwp-download to download a file and suddenly got this error. Running lwp-download.bat solved my problem.
If you experience the "No Perl script found in input" error, try running "where" and then your command; in my example "where lwp-download". If you have more than one file in your path with that name, try to be specific. In my case, add the ".bat"