Skip to content

Offline installation using pip no longer works #2097

Closed

Description

@seisman

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.

Activity

  1. maxrjones commented on Aug 30, 2022

    @maxrjones
    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.

  2. seisman commented on Aug 30, 2022

    @seisman
    MemberAuthor

    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.

  3. seisman commented on Aug 31, 2022

    @seisman
    MemberAuthor

    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?

  4. maxrjones commented on Aug 31, 2022

    @maxrjones
    Member

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

  5. seisman commented on Jun 24, 2023

    @seisman
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions