Python dependences

Juergen Brendel juergen at brendel.com
Tue Apr 21 14:44:59 EDT 2020


Hello!

I always use 'pip', but I heard many people like 'conda'. So far I'm
doing ok with 'pip' and many/most instructions or documentation just
refers to that as well. Still seems to be the most standard way of
installing Python dependencies.

The trick is to always create a nice virtual environment for your
Python project. Then, once you are in that virt-env, you run 'pip' as a
normal user (not sudo!) and everything is only installed within that
environment.

Personally, I like virtualenvwrapper:

       https://virtualenvwrapper.readthedocs.io/en/latest/

 * Each virt-env can have a different Python interpreter/version.
 * Easy switching between virt-envs. Just type "workon <project-name>"
 * You can always jump to the directory in which all the installed
   dependencies are. Just type "cdsitepackages"
 * Jump back to where your sources are: "cdproject"
 * Completely wipe all installed dependencies of the virt-env with a
   single command: "wipeenv"

It really makes it easy working with many different Python projects.

Juergen



On Tue, 2020-04-21 at 11:35 -0300, jorge.conforte at inpe.br wrote:
>  
> 
> Hi, 
> 
> I've already used the python list to clear up some doubts.
> It's been about a year since I started using Python in my projects
> and I
> still have some doubts. For those who have always used IDL, this
> change
> is a little difficult. I already have Ptyhon 3.8 installed, on Linux.
> To
> clear up any doubts, what is the best method to install Python
> dependencies, for example: numpy, matplolib, netcdf, gdal, etc.
> Should I
> use PIP, conda or install using Conda. What I do so that all
> dependencies are installed in the same directory. I installed GDAl
> and
> now I can only use it as root. If you use it as a common user, it
> always
> gives an error message. There is a method that I can uninstall all
> dependencies and install them using PIP, so that they are all in the
> same directory. This question and that I want to use only Python. And
> I
> already installed some dependencies, and some give me an error
> message.
> For example:
> 
> import matplolib
> 
> Traceback (most recent call last):
> 
> File
> <stdin> line 1, in <module>
> 
> ModuleNotFoundError: No module named
> <matplotlib>
> 
> Excuse me for this long question. And that I want to stop
> using IDL and dedicate myself entirely to Python.
> 
> Thanks.
> 
> Conrado
> 
>  



More information about the Python-list mailing list