pygmt icon indicating copy to clipboard operation
pygmt copied to clipboard

Offline installation using pip no longer works

Open seisman opened this issue 3 years ago • 4 comments

Description of the problem

Originally posted by @maxrjones in https://github.com/GenericMappingTools/pygmt/pull/1848#discussion_r950451637

A downside here is that make install no longer works without internet access, even if setuptools>=64 is installed in the environment. I'll do some more searching for a workaround but if anyone knows a solution that would be helpful.

Originally posted by @weiji14 in https://github.com/GenericMappingTools/pygmt/pull/1848#discussion_r950481975

I tried disconnecting and used pip install --no-deps --no-build-isolation --editable=. which seems to work offline (presumably it manages to pick up a pre-downloaded setuptools>=64). However, it results in a editable version named pygmt-0.0.0. Maybe the offline feature can be raised upstream to PyPA?

Originally posted by @seisman in https://github.com/GenericMappingTools/pygmt/pull/1848#discussion_r950638374

A downside here is that make install no longer works without internet access, even if setuptools>=64 is installed in the environment.

It's unrelated to this PR. Offline make install worked for pygmt<=0.2.0 and started to fail since v0.3.0, in which we switched from versioneer to setuptools_scm (https://www.pygmt.org/dev/changes.html#id47). So it's likely a problem for setuptools_scm.

I tried disconnecting and used pip install --no-deps --no-build-isolation --editable=. which seems to work offline (presumably it manages to pick up a pre-downloaded setuptools>=64). However, it results in a editable version named pygmt-0.0.0.

This command gives the correct version for pygmt <= 0.6.0 but results in pygmt-0.0.0 for pygmt v0.7.0. Not sure if it's caused by changes in https://github.com/GenericMappingTools/pygmt/pull/1945.

seisman avatar Aug 30 '22 12:08 seisman

A downside here is that make install no longer works without internet access, even if setuptools>=64 is installed in the environment.

It's unrelated to this PR. Offline make install worked for pygmt<=0.2.0 and started to fail since v0.3.0, in which we switched from versioneer to setuptools_scm (https://www.pygmt.org/dev/changes.html#id47). So it's likely a problem for setuptools_scm.

This comment is confusing to me because I tried make install offline on the commit preceding https://github.com/GenericMappingTools/pygmt/commit/06fca61ae295e8a72f9d81b6cb5669205db08b57 and it worked fine.

maxrjones avatar Aug 30 '22 13:08 maxrjones

Here are a series of commands I run without internet access:

# Uninstall PyGMT first
$ pip uninstall pygmt

# Install the latest main brach (FAILS to find setuptools>=64)
$ git checkout main
$ pip install --no-deps -e .

# Install v0.3.0 [FAILS to find setuptools>=40.8.0) 
$ git checkout v0.3.0
$ pip install --no-deps -e .

# Install v0.2.0 [SUCCEES]
$ git checkout v0.2.0
$ pip install --no-deps -e .

Running pip cache list | grep setuptools gives me nothing. It seems the failures I'm getting is because I don't have setuptools cached.

seisman avatar Aug 30 '22 13:08 seisman

A downside here is that make install no longer works without internet access, even if setuptools>=64 is installed in the environment.

It's unrelated to this PR. Offline make install worked for pygmt<=0.2.0 and started to fail since v0.3.0, in which we switched from versioneer to setuptools_scm (pygmt.org/dev/changes.html#id47). So it's likely a problem for setuptools_scm.

This comment is confusing to me because I tried make install offline on the commit preceding 06fca61 and it worked fine.

It seems there are two different issues here.

  1. installation failure due to missing setuptools caches
  2. incorrect package version (e.g., pygmt-0.0.0)

@maxrjones Are you talking about the first one?

seisman avatar Aug 31 '22 02:08 seisman

Yes, I was talking about the first one. https://github.com/GenericMappingTools/pygmt/issues/2097#issuecomment-1231709317 makes sense as an explanation, as I had setuptools installed in my environment.

maxrjones avatar Aug 31 '22 23:08 maxrjones

I'm inclined to close the issue to reduce the number of our opened issues, mainly because:

  • The need for offline installation is rare
  • It's very likely that setuptools_scm doesn't allow offline installation and there is very little we can do.

Closing the issue but feel free to reopen it if necessary.

seisman avatar Jun 24 '23 04:06 seisman