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

Offline installation using pip no longer works #2097

Closed
seisman opened this issue Aug 30, 2022 · 5 comments
Closed

Offline installation using pip no longer works #2097

seisman opened this issue Aug 30, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@seisman
Copy link
Member

seisman commented Aug 30, 2022

Description of the problem

Originally posted by @maxrjones in #1848 (comment)

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 #1848 (comment)

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 #1848 (comment)

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 #1945.

@maxrjones
Copy link
Member

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 06fca61 and it worked fine.

@seisman
Copy link
Member Author

seisman commented Aug 30, 2022

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
Copy link
Member Author

seisman commented Aug 31, 2022

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?

@maxrjones
Copy link
Member

Yes, I was talking about the first one. #2097 (comment) makes sense as an explanation, as I had setuptools installed in my environment.

@seisman
Copy link
Member Author

seisman commented Jun 24, 2023

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 seisman closed this as completed Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants