Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add installation instructions for pip #433

Merged
merged 3 commits into from
Nov 8, 2018

Conversation

heitorPB
Copy link
Contributor

Several issues report problems with using pip install basemap. A workaround is using the latest version from Github.

Some issues with pip problems: #405 #403 #198 #251

Several issues report problems with using `pip install basemap`. A workaround is using the latest version from Github.

Some issues with pip problems:
README.md Outdated
pip install git+https://github.com/matplotlib/basemap.git
```

You migh want to run pip with administrative privilegies (e.g. `sudo pip`) or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should encourage sudo pip. Let's only promote the --user option.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install from the Git repositories work on MacOS Mojave with Python 3.7 and pipenv and/or pip.
Reference: https://stackoverflow.com/questions/51963619/pyproj-fails-to-compile-when-i-pip-install-it-and-its-not-about-gcc

  • With pipenv
$ pipenv install cython
$ pipenv install git+https://github.com/jswhit/pyproj.git#egg=pyproj
$ pipenv install git+https://github.com/matplotlib/basemap.git
  • With just pip:
$ pip install -U cython
$ pip install -U git+https://github.com/jswhit/pyproj.git#egg=pyproj
$ pip install -U git+https://github.com/matplotlib/basemap.git

@heitorPB
Copy link
Contributor Author

Updated with @phobson suggestion.

@WeatherGod
Copy link
Member

Does this method work in a clean environment? How does it handle the libgeos stuff?

To be honest, I'd rather promote the conda-forge approach to installing basemap. Or, even better, pip install cartopy.

@heitorPB
Copy link
Contributor Author

Assuming you have pyproj installed, the pip command works. pyproj also has a pip install problem. I understood this method compiles the libgeos stuff included in the repo.

What is the advantage of conda-forge? IMHO, having several package managers is a nightmare. A quick browser in coda's documentation showed me that most packages I use are not available there. And they are in pip.

@ocefpaf
Copy link
Contributor

ocefpaf commented Oct 24, 2018

Assuming you have pyproj installed, the pip command works. pyproj also has a pip install problem. I understood this method compiles the libgeos stuff included in the repo.

Ideally we should start building wheels for pyproj to facilitate the life of pip users. Basemap I'm not so sure due to the deprecation. We don't want to encourage people to use something that is at the end life support.

What is the advantage of conda-forge?

It is a collective of packages (5508) managed openly by the community:

https://anaconda.org/conda-forge/repo

IMHO, having several package managers is a nightmare.

Indeed. That is why people are moving to conda and using conda-forge for packages. It is platform and language agnostic. As it evolves it becomes the only package manager you will ever need. (Still rough around the edges with haskell, rust, and go. But great for Python and R.)

A quick browser in coda's documentation showed me that most packages I use are not available there. And they are in pip.

Not sure what you are using but take a look at the conda-forge channel package listing and not conda's documentation. Also, if a package is not there. It is relatively easy to add.

@heitorPB
Copy link
Contributor Author

Oh, Basemap is being deprecated?

Ideally we should start building wheels for pyproj to facilitate the life of pip users.

I submitted a PR there with instruction to pip install pyproj from github as well. But wheels would be better.

@ocefpaf
Copy link
Contributor

ocefpaf commented Oct 24, 2018

Oh, Basemap is being deprecated?

See the @WeatherGod's (the basemap maintainer) #433 (comment) and the EOL docs: https://matplotlib.org/basemap/users/intro.html#cartopy-new-management-and-eol-announcement

I submitted a PR there with instruction to pip install pyproj from github as well. But wheels would be better.

pip install from github and expecting to have the libs and compilers is too advanced for the average user. Building wheels are not that hard with the new technologies, but unfortunately that is up to the PyPI package authors/maintainers and many do not have the time to do that. That is why conda-forge is better, it is a community that not makes packaging easy to anyone who wishes to crate or maintain, not only the package authors/maintainers. Also, b/c most of the libs, like geos, gdal, proj.4, etc, are already package for Linux, Windows and OS X, so creating a python package that depended on those is not a burden.

@matthew-brett
Copy link

I can't say whether conda-forge is better, but there are a lot of packages using (my) https://github.com/matthew-brett/multibuild framework for wheel building. It's not completely trivial, but it's not that hard either. I'd guess about 3 -4 hours for the initial setup.

@heitorPB
Copy link
Contributor Author

pip install from github and expecting to have the libs and compilers is too advanced for the average user.

I agree. Even though is a matter of copying and pasting, it's too advanced for the average user. Expecting them to read the [f] manual is not compatible with the reality :/ Learned that the hard way.

See the @WeatherGod's (the basemap maintainer) #433 (comment) and the EOL docs: https://matplotlib.org/basemap/users/intro.html#cartopy-new-management-and-eol-announcement

I was not aware of cartopy when I started a project, will see how difficult it is to adapt to it. I suggest to add a line in the README and in the documentation about this. So if someone finds Basemap in Google or somewhere else, they'll know that this project is at the end of life...

But while cartopy has not all Basemap's features, there should be an easy enough way to install it with pip.

@WeatherGod WeatherGod merged commit aef742a into matplotlib:master Nov 8, 2018
@ver0z
Copy link

ver0z commented May 13, 2020

I solved this by uninstalling the conda and reinstalling, defining on installation the conda path on variable environment. After, at settings on your project, set the project interpreter to C:\Users\the_user_name\anaconda3\python.exe, then try to install the basemap. It was the only way I got this, after many tries and bugs with pip I tried with conda and that's it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants