-1

Having some weird troubles installing python modules on my work computer (read: no admin/root rights), I'm using 2.7.5. I downloaded and unpacked the tarball and ran 'setup.py', but it had no effect: When I open the python shell, it can't find the module (this specific one is fuzzywuzzy). However, if I right click -> edit with IDLE the setup.py, and then run the shell from that file, it loads and works perfectly fine. Or, if I then open a new file from that shell, use the module and run it, it works fine. -__-

I've tried using:

import sys
sys.path.append('path here')

to append the location where the module is installed, but this doesn't help, nor does the path stay in the sys.path list when I close/reopen the shell.

This is actually driving me insane. Can anyone help? I'm relatively new to programming and python.

vaultah
  • 44,105
  • 12
  • 114
  • 143
carusot42
  • 1,171
  • 10
  • 17
  • Are you sure you're running `setup.py` with the same interpreter you're trying to `import` into? – jonrsharpe Apr 08 '15 at 19:53
  • Are you using windows or mac? If windows add path manually in `Environmental Variables` – Sailesh Kotha Apr 08 '15 at 20:00
  • Do you have more than one version of Python installed? Calling `setup.py` *can* use a different Python to calling `python setup.py`. – Peter Wood Apr 08 '15 at 20:44
  • See this possibly related question about [Python file associations](http://stackoverflow.com/questions/8196314/how-do-you-change-file-association-for-py-python-files-in-xp). – Peter Wood Apr 08 '15 at 20:53
  • you should add the path to the PYTHONPATH environment variable. To see which paths python actually knows about, open a command shell and execute `python -m site` – miraculixx Apr 09 '15 at 06:06

1 Answers1

1

The best and easy way provided by python to install/uninstall packages is to use PIP. use this

python -m pip install packagename==version

same way to uninstall

python -m pip uninstall packagename==version

if you are using windows you need to set path variable first usually python file will be in path C:\Python27 to set path variable

PATH=%PATH%;C:\Python27;
Chiyaan Suraj
  • 1,021
  • 2
  • 13
  • 27