Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - how can I change default path when installing modules?

I'm trying to install a Python Module by running a Windows installer (an EXE file). The Problem is that the default python folder and the defualt Installation Library are set To disc D:\ and are grayed out (meaning I can't change it). It might be fine is some places, but in my computer, D is the DVD drive, meaning that no installation is possible.

Is there any way to change this or to overcome this? The default path

like image 517
jonatr Avatar asked Jan 04 '12 12:01

jonatr


People also ask

How do I change the PATH when installing Python?

To change install location, click on Customize installation , then Next and enter C:\python35 (or another appropriate location) as the install location. If you didn�t check the Add Python 3.5 PATH option earlier, check Add Python to environment variables .

How do I choose where pip installs?

Click on the Advanced system settings link on the left panel. Click Environment Variables. Under System Variables, double-click the variable PATH. Click New, and add the directory where pip is installed, e.g. C:Python33Scripts, and select OK.

Where should Python modules be installed?

Typically, that means Python and all packages will get installed to a directory under /usr/local/bin/ for a Unix-based system, or \Program Files\ for Windows. Conversely, when a package is installed locally, it's only made available to the user that installed it.

What is PATH while installing Python?

(1) The Python application path, which is the folder where you originally installed Python. You can find the Python application path by following these steps: Type “Python” in the Windows Search Bar. Right-click on the Python App, and then select “Open file location“


2 Answers

It's not "default folder", and there's a reason there's "found in registry" next to the version. You need to re-register the Python installation if you've moved it, either by installing it again (without removing) in the same folder, or changing the directory saved in registry (HKCU\Software\Python\PythonCore\X.X\InstallPath, possibly on Wow3264Node) either manually or using registration script.

like image 112
Cat Plus Plus Avatar answered Sep 23 '22 05:09

Cat Plus Plus


Because what you're installing (you don't say what it is) seems to be standard distutils-generated installer (as Cat Plus Plus points out in his comment) you don't have to install it by running installer. You can install it using easy_install program what allows you to choose which Python to use. See my answer to Can I install Python windows packages into virtualenvs? question.

EDIT

Now I see in your comment you're installing setuptools. This complicates things a little bit as this is the package which contains easy_install tool I mentioned above. You have chicken/egg problem here... There's solution for this, however. You can use ez_setup script to install setuptools without using exe installer.

like image 25
Piotr Dobrogost Avatar answered Sep 20 '22 05:09

Piotr Dobrogost