mjp
mjp

Reputation: 1689

Installing modules reliably in one location

I've been working with Python for a little while now but have come to absolutely detest installing new modules. It always seems to take me a full work day to install one additional module. This last happened with mpl_toolkits and now it is happening with gdal.

The main issue seems to be that easy_install/pip/get-app aren't saving a file in the correct location and so Python (I'm using Spyder) can't find it. How do I install a module in a location so that Python can find it?

I have been reading guides, articles, manuals and Stack Overflow articles all day now and I feel this needs a new question as I can't find an answer.

I installed using:

sudo apt-get install gdal-bin

I also tried with:

pip install gdal

but this fails with the error:

Command "python setup.py egg_info" failed with the error code 1 in /tmp/pip-build-NWJT2f/gdal/

I looked for the files using

dpkg -L gdal

and then added the file path this said into Spyder's preferences option for PYTHONPATH, but it still couldn't find it and so I'm guessing this is wrong.

I have read the official documentation of PYTHONPATH, but it's very short and doesn't really explain it at all.

Upvotes: 0

Views: 52

Answers (1)

user6072577
user6072577

Reputation: 349

I recommend trying anaconda or miniconda, which manage environments and install packages - it 'just works'.

https://www.continuum.io/downloads

Upvotes: 1

Related Questions