I'm trying to get new packages (request for example) and trying to do it through easy_install, but when I try to open it (both easy_install and easy_install-3.6) all I get is a blank terminal screen popping up for a second and than closing with nothing happening. What's wrong with it and how can I get new packages?
easy_install must be used as a command in the command prompt and it cannot be opened as an application. Go to the folder where easy_install is and open command-prompt in that folder. Now perform installation of any libraries using:
>easy_install pandas #example
Or you can set this path in your environment variables and use it instead of using this path to install everytime.
Related
I have been having issues with pip on Python 3.10 attempting to install a package gives me the following error
pip : The term 'pip' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and
try again. At line:1 char:1
I have tried reinstalling pip and I have also tried reinstalling python.
This error shows up on windows when one tries to use pip in the command prompt. To solve this error on windows, you must declare path variable by following these steps:
Step 1 - Right click on My Computer or This PC
Step 2 - Click on Properties
Step 3 - Click on Advanced System Settings
You will find a section called system variables.
Click on Path from the list of variable and values that shows up there.
After clicking on path click edit.
You will find a New button in the pop up.
Click that and paste the location of the python35 or python36 folder (The location you specified while installing python) followed by “\Scripts” there.
For me its “C:\Users\a610580\AppData\Local\Programs\Python\Python35-32”
so I type “C:\Users\a610580\AppData\Local\Programs\Python\Python35-32\Scripts”
Click Ok to close all windows and restart your command prompt.
I repeat - restart your command prompt.
This error is given by Windows, saying that pip is not found. It happened because Python isn't in your shell path, If you just installed Python, logout your user and log back in see if it resolves, if not, Python is not in your PATH.
For me, the most convenient way is reinstalling Python and checking every checkbox that says something like "Add python to PATH/environment variable" in the installer. You can also follow the other answer to add PATH manually.
I am trying to open a python script in cmd however, [Errno 2] is popping up! Can anyone help, i've tried everything.. even trying to add the path to the system variables.
Also, for some reason, whenever i enter a basic command like cd, 2 lines are skipped and nothing happens.
Try to open your command line and navigate into the directory where your Python file is located. You can do this by:
cd "<your-path-here>"
Now you can see, that it does not say C:/Nicole/... anymore, but this specified directory.
To ensure that your file is within this folder you can do
dir # suggestion from comment
this will list all files within this folder. If you now do
python snippet.py
it will execute the Python file.
Your problem it's still foggy. Anyway, you must install two python packages:
nltk (as the message 'module nltk not found' suggests)
numpy
To achieve this, use the 'pip' tool from the command prompt:
c:\Users\nicol> pip install nltk
c:\Users\nicol> pip install numpy
Depending on your Python flavour, the command may become
py -m pip install nltk
or a similar one (READ THE DOCS!) or it may use a different way to install packages.
Then, you must fix your snippet by adding these lines:
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
nltk.download('universal_tagset')
nltk.download('maxent_ne_chunker')
nltk.download('words')
just after the 'import nltk' statement.
If you plan to have fun with Python, a powerful tool like 'PyCharm' it's a 'must have'. Download it from JetBrains site.
Go to the folder your script is saved and Shift+Right Click and select Open Powershell Here. And run the same command. Or if you really want cmd go to the address bar and type in cmd and run the command there.
this is my first time on posting a thread on stackoverflow, but I have used this many times in the past. I am having a problem when compiling my python files. I have looked many times on here and on other sites on how to do this and I keep getting the same answers. For some reason, on my computer, I cannot run/install pip. Whenever I try to install pip by using the python command, it is not recognized. I saw a thread on here about using 'py' instead of 'python', this is accepted as a command but when I try to install pip it just errors. I have installed python several times and have also repaired it several times, but nothing seems to work.
Any help would be greatly appreciated!
Welcome to stackoverflow!
this is an image i took from a website if you would like to use PIP
the website: https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line
I took a look at the directory that you specified in your comment. Pip is not an executable file there, but rather is python source code. What I found that worked and allowed me to run Pip successfully was to import Pip as a module within the system Python environment. Then run Python specifying Pip as a loaded module using the -m flag to call pip as an executable with its own arguments (e.g. C:\Users>python -m pip --version). The steps to set this up are included below:
Step 1: Verify that Python is installed and is added to your PATH variable
From cmd, run the command: C:\Users> where python. You should be returned a file path to the executable for Python.
If instead you receive an error message that says the following: "INFO: Could not find files for the given pattern(s)." that means that Python is not added to your $PATH variable (See below for details on how to configure your PATH variable.
Step 2: Add Pip source code as a module within Python
Run python from the cmd: C:\Users> python
Run the command import pip within the python shell:
Run the command exit() to return to the cmd from the Python shell.
Step 3: Validate that pip can be used as a module within Python
Run the following command to check Pip's version as a validation that Pip and Python are configured correctly: C:\Users> python -m pip --version
Validate that you are returned a version number
Configuring PATH environment variable (Windows 10)
From the start menu search box, type "edit the system environment variables".
Open the application that is returned (should pop open the control panel).
Click the button entitled 'Environment Variables'
If you have a variable defined as 'PATH' already, click the edit button, then click 'new' in the following dialog box. Specify the path to your Python executable ( C:\Users\jakes\AppData\Local\Programs\Python\Python37-32\Lib\site-packages). Click 'Ok' and then 'Apply.'
If you don't already have a 'PATH' variable defined, click 'new' and define a name of 'PATH' and add in the file path to the Python executable as the variable's value.
Close any active Command Prompts! After making changes to your PATH variable,you will need to close any active sessions in order to allow the update PATH variable to be propagated within the session.
Open a new Command Prompt window and run the command: C:\Users> where python to verify that the your changes were made correctly, and that they have fully propagated within the system.
I'm pretty new to the community, and new to python. I know the basics. But now I'm trying to download third party modules via pip but everything I do regarding pip displays an error. I know that pip comes with python seeing as the pip file is there.
I am running python 3.6 and windows 10. I have downloaded pip off the internet also but when I try to run the program it says already downloaded. The first time I ran it it said that it was downloading and successfully downloaded so I'm kind of lost.
Thanks!
Sounds like it's already properly installed. pip is a program called from a system terminal, not from a Python prompt. Open up a command prompt and type pip -h see what happens. If this does not print out the help page on how to use pip, and instead you get an error to the effect of:
"pip" is not recognized as an internal or external command, operable program or batch file
You then need to point Windows where to find the program (pip.exe) by adding your Python scripts folder C:\...\Python36-32\Scripts\ to your environment PATH variable. To do this, open the Start menu and search for "environment variables". Open the dialogue and find one named PATH (case doesn't matter). If it doesn't exist, create it. Edit the value and add the file path to the scripts folder to the end using ; as a separator.
As per your comment, if you are getting an access denied windows error this answer from another question may help you.
You need need to be sure either your powershell is being run as administrator, or by creating a virtual environment.
The Installing Packages docs have a great overview, and instructions.
https://packaging.python.org/installing/#use-pip-for-installing
I am trying to install Django by using a tutorial.(tutorial.)
I download the latest release (1.6.2) and untar(unzip) it.
Then I open the file that contains Django on my Desktop and copy the Directory.
I open the command prompt.
From C:\Users\Name\Desktop> I type cd and I paste the Directory.
This opens the Django directory which is C:\Users\Name\Desktop\Django-1.6.2
Inside this file there is a setup.py file.
According to the tutorial if I type python setup.py install it will install Django for me! And this actually happens in the tutorial video but not in my case!!!
When I type it gives me the following:
'python' is not recognized as an internal or external command, operable program or batch file.
If I go into the Django file and Double-click the setup.py file I momentarily see in the window (before it closes) error: no commands supplied
What must I do? I am trying to install Django for 2 days now and it is getting really frustrating.
SOLVED
Must set Path Variable from Environmental Variables FIRST!
For a quick solution, look at the answer + this post and choose melhosseiny's answer.
Use the command C:\Python27\python setup.py install
Additionally, if you don't want to add C:\Python27\ to all of your python commands, you need to add it to your Windows Path. This can be done by going to your environment variables and add C:\Python27 (notice the lack of a trailing slash) to the PATH variable. Make sure you are adding to, not replacing, the values there are present.