Can't install setuptools (python) - python

I have Windows 7 (64-bit) operating system. I have installed python. I want to install setuptools (for python).
In their website (https://pypi.python.org/pypi/setuptools) it is written: "Download ez_setup.py and run it;"
I download that file, save it to my hard drive. Then when I click (right mouse button) and select "Open with"-> "python", a black console screen appears for a second, then disappears. And that's all.
What is wrong and how can I install that software?

Open a command prompt (Start menu -> cmd.exe)
Navigate to the directory where ez_setup.py is saved, e.g.:
cd C:\Users\You\Downloads
Run it (C:\Python27\ should already be on your %PATH%; if it's not, add it -- see below):
python ez_setup.py
Read the output. If it worked, you should be able to install packages like so:
C:\Python27\Scripts\easy_install jinja2
Add the path to easy_install to your %PATH% so that you can use it easily from any directory:
Control Panel -> System -> Advanced system settings
Click the Environment variables... button
Edit PATH and append ;C:\Python27\Scripts\ to the end (substitute your Python version)
Click OK. Note that changes to the PATH are only reflected in command prompts opened after the change took place.
If something goes wrong, the command prompt will remain open after the program finishes, so you'll be able to read the error and use it to resolve the problem.

Related

Cant use the coockiecutter command after pip install windows

I went on the cmdl and pip install cookiecutter
This worked fine because when i do
pip show -f cookiecutter
I have the information of where it was saved(i.e: c:\users\name\appdata\roaming\python\python39\site-packages
But when I try to run the following command in the folder I want my template to be created in
cookiecutter -c v1 https://github.com/drivendata/cookiecutter-data-science
This error message is displayed:
'cookiecutter' is not recognized as an internal or external command,
operable program or batch file.
After reviewing countless other similar posts, I think this might have to do with the virtual environment or path that is active but I have no idea what that means and how to make changes in my system.
To use cookiecutter, type "python" in the Windows search bar. Your current python version should show up. In the window that pops-up, click "open file location". Right click the python shortcut icon and click "open file location" again. Look for the "Scripts" folder and double click it. If you installed cookiecutter correctly, you should see it in the "Scripts" folder.
Copy the file path and open up "System Properties". In "System Properties", click on "Environment Variables", then open up "PATH" and add the link you just copied to path. Click "OK" to all and restart the command prompt. Using the command prompt, go to the folder where you want to set up the project in your local system and run the following:
cookiecutter -c v1 https://github.com/drivendata/cookiecutter-data-science
If it works, it should ask you for project name, author name etc.

How to install Python on a recent Windows computer in C:\Program Files?

I'm starting to get extremely FURIOUS with the latest Windows environments (Windows 10):
I've just downloaded and installed Python, version 3.9.
The installer proposed to install it under "C:\Users...", I thought "No way, because if, for whatever reason, I remove this user, I might remove an installation of a program.", so I decided to install it under C:\Program Files, which is the most obvious place to install something.
First, that was not allowed: apparently that directory has special permissions, so I have started the installer as administrator. Everything went OK (at least that's how it looked): all files/directories seem to be present.
Then, I wanted to add some extra libraries, for which I wanted to launch pip3 install ..., but 'pip3' is not recognized as an internal or external command, operable program or batch file..
So in the Windows explorer, I typed file:pip* and indeed, nothing found.
Having a manual look into the directory C:\Program Files\Python\Python3.9\Scripts, I did find all pip versions (the normal one, the version 3 and the version 3.9 one), but having a look at my PATH environment variable, there seems to be nothing there, referring to my justly created C:\Program Files\Python directory.
So, my questions are very simple:
I am able to change my PATH variable myself, but what are ALL the directories I need to put there?
Why on earth does the Windows find feature not show the pip* files, when I look for them using the search parameter file:pip*?
Are there any other surprises I can expect?
Thanks in advance and sorry for the frustration in my question.
Yes, you can add the python binaries to PATH manually, but there may be a simpler option. In the first screen of the installer, there is a box that says "Add Python 3.9 to PATH":
For some reason, this box is not checked by default. So if you want pip and other binaries to be added to path during installation, you can just check this box.
So if you want, you can uninstall python (again) and reinstall it, this time making sure that box is check. However, if you want to just add the binaries to PATH manually, this is how you could go about doing that.
First, you need to get the path to the folder containing your binaries. To do that, navigate to your python installation, find the folder with the pip binaries, select it, and click "Copy path"
Now the path to that folder is copied to your clipboard.
Next you need to add that path to your PATH environment variable. To do that, follow these steps:
Go to start menu and type "path". Select the option that says "Edit system environment variables".
Click "Environment Variables..."
Scroll down and find "Path". Select it and click "Edit..."
Click "New"
Press Ctrl+v to paste the path you copied earlier. Hit enter.
Press Ok on each of the three open dialogues.
The pip binaries should now be in your path! Note that this procedure will work for adding any folder to PATH.

PIL (Pillow) module install issue

I have been attempting to install the Pillow (PIL) module into my python(3.8.2) using Windows 10 to no success.
I have tried executing pip install Pillow as mentioned by the website in my cmd but both pip and python are 'not recognised as an internal or external command, operable program or batch file'
What I have tried:
Reinstalled both pip and python and tried again, with the same problem.
Using powershell instead of command prompt (not sure if that makes any difference).
Also I understand you can download the Pillow module package in .whl, but I couldn't work out how to install it that way.
I have also installed pygame using the cmd before which baffles me as to why this is happening.
Any and all help is appreciated, Thank you!
If you're sure that you've successfully installed python, but it's not working on your commandline, it may not be in your PATH. Open the search in the windows start menu, and type "env" and click on "Edit Environmental Variables for your system (or choose account if you don't have admin on the system). If you chose system, click on the environmental variables button. You will then be greeted by one window split into two menus, User Variables and System Variables. Scroll down in the User variables and double click on Path.
Go find the location of your python install with the python.exe file in it (you could search for it in your C:\ if you're willing to wait). Add that path to the Path variable list.
If you can't find the python.exe or just don't want to wait, reinstall your python installation and look for a checkbox with "Add to Path" or something along those lines.
In addition to the python.exe being in your path, make sure to add the "Scripts" folder in your path. It should be a subfolder in the same folder as python.exe.
For windows 10 install PIL and cImage.
Install Python 2.7.8 (64-bit — this is important)
https://www.python.org/ftp/python/2.7.8/python-2.7.8.amd64.msi
Install Python 3.4.1 (64-bit — this is important)
https://www.python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi
Download and install Pillow for Python 2
https://pypi.python.org/packages/2.7/P/Pillow/Pillow-2.5.3.win-amd64-py2.7.exe#md5=33c3a581ff1538b4f79b4651084090c8
Download and install Pillow for Python 3
https://pypi.python.org/packages/3.4/P/Pillow/Pillow-2.5.3.win-amd64-py3.4.exe#md5=6ee659d7b945e826a07c53c15578424f (direct link)
https://pypi.python.org/pypi/Pillow/ (all other versions)
Download and install cImage
Navigate to https://github.com/bnmnetp/cImage
Click cImage.py, and click the button labeled Raw to see the contents of the file.
Click File > Save Page As (Chrome & Firefox) or File > Save As (Safari) to save the file on your computer.
Copy “cImage.py” from where you saved it to C:\Python27\Lib\site-packages and C:\Python34\Lib\site-packages\

pip.exe missing in python scripts module

correction
i edited the environment variable to path Scripts, but in the command prompt on typing the pip command it does not shows up the package installation
python\scripts location picture
While executing the pip command in the command prompt, it shows pip is not recognized as an internal or external command, operable program or batch file.
I tried setting environment variables and all other alternative solution still I am not able to solve it. I recently noticed pip.exe file missing from python/scripts module.
Is that reason to show up this error? if it is yes, how will I install it manually?
You should add the full directory to the Scripts folder to your PATH environment variable. When you run commands in a command prompt, Windows will search through the folders listed in PATH.
Assuming you are on Windows 10:
Press the start button then search "Environment Variables"
Click the "Edit Environment Variables" option.
Click the "Environment Variables" button in the box that pops up.
Scroll down and find the PATH variable, double click it.
Click "New"
Paste in the path to the Scripts folder.
Save it and exit, then restart the terminal. Now pip will be recognized.
Finally I solved it.I used python 3.8.3 version.Not folder named "Scripts" in this version.I just delete this version and reinstall python 3.7.8 version and then pip is here :D
I know this has been solved, but another way of dealing with this is to create an empty file in the 'Scripts' folder and rename it to pip.bat. Then add the following code:
python -m pip %*
Which simply passes all the arguments of the pip command to python.

How to run PyCharm in Ubuntu - "Run in Terminal" or "Run"?

When I double-click on pycharm.sh, Ubuntu lets me choose between "Run in Terminal" and "Run". What is the difference between these options?
To make it a bit more user-friendly:
After you've unpacked it, go into the directory, and run bin/pycharm.sh.
Once it opens, it either offers you to create a desktop entry, or if it doesn't, you can ask it to do so by going to the Tools menu and selecting Create Desktop Entry...
Then close PyCharm, and in the future you can just click on the created menu entry. (or copy it onto your Desktop)
To answer the specifics between Run and Run in Terminal: It's essentially the same, but "Run in Terminal" actually opens a terminal window first and shows you console output of the program. Chances are you don't want that :)
(Unless you are trying to debug an application, you usually do not need to see the output of it.)
The question is already answered, Updating answer to add the PyCharm bin directory to $PATH var, so that pycharm editor can be opened from anywhere(path) in terminal.
Edit the bashrc file,
nano .bashrc
Add following line at the end of bashrc file
export PATH="<path-to-unpacked-pycharm-installation-directory>/bin:$PATH"
Now you can open pycharm from anywhere in terminal
pycharm.sh
For Pycharm CE 2018.3 and Ubuntu 18.04 with snap installation:
env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop /snap/bin/pycharm-community %f
I get this command from KDE desktop launch icon.
Sorry for the language but I am a Spanish developer so I have my system in Spanish.
As mentioned in the above answer, by updating the bashrc file you can run the pycharm.sh from anywhere on the linux terminal.
But if you love the icon and wants the Desktop shortcuts for the Pycharm on Ubuntu OS then follow the Below steps,
Quick way to create Pycharm launcher.
1. Start Pycharm using the pycharm.sh cmd from anywhere on the terminal or start the pycharm.sh located under bin folder of the pycharm artifact.
2. Once the Pycharm application loads, navigate to tools menu and select “Create Desktop Entry..”
3. Check the box if you want the launcher for all users.
4. If you Check the box i.e “Create entry for all users”, you will be asked for your password.
5. A message should appear informing you that it was successful.
6. Now Restart Pycharm application and you will find Pycharm in Unity dash and Application launcher.."
First, go to that folder which is containing pycharm.sh and open terminal from there. Then type
./pycharm.sh
this will open pycharm.
bin folder contains pycharm.sh file.
You can launch PyCharm from terminal using pycharm-community or pycharm-professional if installed via snap. See here for more details: Location of PyCharm after install PyCharm as snap package
Yes just go to terminal
cd Downloads
ls
cd pycharm-community-2021.2.2 (your pycharm version)
ls
cd bin
ls
./pycharm.sh
It will open your continued pycharm project
I did the edit and added the PATH for my Pycharm in .bashrc but I was still getting the error "pycharm.sh: command not found".
After trying several other things the following command resolved the issue which creates a symbolic link.
sudo ln -s /snap/pycharm-community/267/bin/pycharm.sh /usr/local/bin/pycharm
The first is location to the exact path to pycharm.sh and the second is user bin which should be on PATH env by default
Official docs says if you have installed pycharm at this location: /opt/pycharm/bin/pycharm.sh then you can make it callable from terminal by using this command:
ln -s /opt/pycharm/bin/pycharm.sh /usr/local/bin/pycharm

Categories

Resources