1

Trying to get pyNastran onto an air-gapped machine with a new install of Anaconda.

I've tried conda install pyNastran-0.7.1.zip on the zipped source code, and conda install setup.py inside the unzipped folder. Both commands cause conda to try to get "package metadata" from https://repo.continuum.io/pkgs and fail when they can't reach the server, despite this being the method suggested here.

python setup.py install fails due to setuptools not being installed, and installing setuptools through python fails, apparently due to setuptools not being installed (?!).

I must be doing something wrong here. How do I get this to install?

Mike Müller
  • 82,630
  • 20
  • 166
  • 161
Daniel F
  • 13,620
  • 2
  • 29
  • 55

1 Answers1

4

conda can only work with tar.bz2 files.

So, unzip pyNastran-0.7.1.zip and re-zip as pyNastran-0.7.1.tar.bz2 using some zipping tool.

Now, you need to tell conda to work offline with --offline:

conda install  --offline  pyNastran-0.7.1.tar.bz2
Mike Müller
  • 82,630
  • 20
  • 166
  • 161
  • Well, it's an improvement, but now I'm getting another error: `PackageNotFoundError: Package not found: ' ' Package missing in current win-64 channels: \n pynastran-0.7.1.zip`. Do I need to put the zip file anywhere in particular before I install it? – Daniel F Jan 05 '17 at 13:32
  • 1
    I'm not sure if `conda` can use `zip` files. Try to make an `tar.bz2` from the zip file (unzip and re-zip in the other format). – Mike Müller Jan 05 '17 at 14:11
  • Great. I Incorporated that into the answer. – Mike Müller Jan 05 '17 at 14:40
  • @Mike Müller Is your answer a general, proper and safe rule to install non-conda packages in the Anaconda python environment? I.e., if I were to install python-pptx, which is not on a list of Anaconda packages ("All"), is it recommended to follow your answer or is there a better way to do it? I am asking, because you have a different answer here: https://stackoverflow.com/questions/57326043/how-to-install-packages-in-conda-that-are-not-available-in-anaconda-conda4-7?rq=1 – Mike Sep 24 '20 at 07:01
  • The OP already has `conda` package on his machine but no internet connection. The other answer you refer to works if the package is only available via PyPi and the user does have an Internet connection. The installation uses `pip`, which installs from PyPi. – Mike Müller Sep 24 '20 at 08:00
  • @Mike Müller: Thank you for your replay. Probably the most generalistic approach to installing non-conda packed packages in a conda environment can be found here: https://conda-forge.org/docs/user/introduction.html. Thi is what I was looking for in the first place. – Mike Sep 24 '20 at 09:34
  • I know conda-forge und use it intensively. It does not apply to this question because the conda package is already on the computer of the of the user. – Mike Müller Sep 24 '20 at 12:56