Install all Anaconda packages in air-gap computer - python

I have computer that is not connected to the internet.
I download Anaconda installation wizard , but it is not contains all the packages that Anaconda contains in their website , and this uncomfortable .
How I can download all the packages that display in Anaconda for offline installation (the size of the installation is not a problem).

According to the Anaconda page here: Obtain a copy of the system appropriate installer, copy to the air-gapped machine, then follow the detailed instructions for you operating system (see links under "Detailed installation information".
Check the environment tab and see if the package you want is part of the environment, but not installed - many are already there. If it is part of the environment, then use the interactive installer to get it installed.
You can also try (from the command line/console) conda install <package-file-name>.tar.bz2 if you have a particular downloaded package that you want to install. Obviously in this case it needs to be a tar.bz file, but you should be able to modify that for other compression types.
Other environments, such as R are also available in the downloaded, but not installed category.
I think (not sure on this) that things such as Rstudio need to be downloaded separately to install.

Related

Should I reinstall all Python libraries if I install Anaconda's Python as primary in my system?

I have been using Python on Windows for some time to analyze survey data, usually available in the form of Excel files. For this reason I have installed several libraries, including pywin32, holoview, bokeh, pandas, numpy and so on.
Now I have found that there is a Python distribution called Anaconda which is a prerequisite for some artificial intelligence libraries that I would like to use.
I downloaded it, but when I install it, it recommends me to register the Python included in Anaconda as primary. This would mean that it would be seen as such by all the tools I use, such as PyCharm.
If I understand correctly, it is possible to have several Python installations on a PC, but what happens to the libraries? I mean, if I make Anaconda's Python primary, do I have to reinstall all the libraries I used before to run the programs I have already written?
I can't find an answer in the Anaconda FAQ, so before proceeding with the installation, I would need to better understand what conflicts I might possibly create on my system.
Here are the some answers from my side.
1. Will the libraries & files conflit?
No. - Both local & Anaconda will have separete site packages folders to store installed libraries.No matter how many different versions of python you install there will be separate site-packages folders named with respective versions to store installed libraries.
2. Should I need to re-install packages again that I'm alredy using in older python before I run a program on anaconda?
Yes. Local python will use - cmd -WIndows command prompot
Anoconda will use - Anaconda prompt - Which will be installed along with installation. Both Anconda and local python maintains separate storage locations in order to store & process data which includes libraries, settings, Environments, cache....
3.if we selects Anaconda as primary. This would mean that it would be seen as such by all the tools I use, such as PyCharm?
No. Pycharm will have old configuartion whatever you using currently
even thouh we install anaconda & make its a primary. But, still you
can use anaconda from pycharm by creating a virtual environmnet for it.

PyCharm cannot install packages

Short description: two computers in the same network, in the new one only those python scripts work that use native packages.
I have Pycharm in my old computer and it has worked fine. Now I got a new computer, installed the most recent version of Python and Pycharm, then opened one of my old projects. Both the old and the new computer are in the same network and the project is on a shared folder. So I did the following:
File - Open - selected the project. Got a message that there is no interpreter
Add local interpreter - selected the latest Python 311 exe. So location of the venv is the same as in the old computer (because it's a network folder) but Base interpreter is pointing to the C drive of my new computer.
PyCharm creates a virtual environment and the code runs fine.
I select another project which uses imported packages such as pandas. Again, same steps as above, add local interpreter. Venv is created.
I go to File - Setting - Project and see that pip, setuptools and wheel are listed as Packages. If I double click one of these, I can re-install and get a note that installation is succesful, so nothing seems to be wrong in the connection (after all, both the old and the new computer are in the same network.
I click the plus sign to add a new one, search pandas. Installation fails. Same thing if I try e.g. numpy.
Error message has lots of retrying, then "could not find the version that satisfies the requirement pandas (from versions: none", "not matching distribution found for pandas" (pip etc. have the latest versions).
After few hours of googling for solutions, I have tried the following:
Complety uninstall and reinstall python and PyCharm. Checked that PATH was included in the installation.
Tried launching pip command from shell
Changed http proxy to auto-detect
Typed 'import pandas' in PyCharm, then used the dropdown in the yellow bulb but there is no install option
Started a new project in the new computer, tried to install pandas
All failed. I'm surprised that changing computers is this difficult. Please let me know if there are other options than staying in the old computer...
If you want to use venv in the network, please use SSH interpreter. Pycharm supports this method. Shared folders are not a recommended usage, For pycharm, it will consider this as a local file. If the file map is not downloaded locally, it will make an error.
Another way is to reinstall the project environment on the new computer through requirement.txt. Reasonable use of requirements.txt can effectively avoid many project bugs caused by environment migration or different dependent versions. Before installing some scientific module such as pandas, it is recommended to install visual studio build tools, such as gcc ...
This took a while but here is what happened. Package installation did not work in project settings. Neither did it work when you select Python Packages tab at the bottom of the screen. The only thing that worked was to select the Terminal tab and manually install (pip install) there. We use a trusted repository but for other users, the easier package installation methods work. Not sure why they do not for me but at least there is this manual workaround.

Pip installed packages don't show up in Anaconda Navigator

Many Python packages don't have pre-built conda packages, so Anaconda users are frequently forced to use pip to install packages. I have to do this routinely, since so many packages don't have conda packages, not even in the most common alternate channel(s) like conda-forge or bio-conda.
This open issue was already reported in the Anaconda github support repo https://github.com/ContinuumIO/anaconda-issues/issues/10634. However, no answers have been forthcoming in almost 1 year. I am asking here because responses are typically faster and shared more widely than in support forums for individual products.
I hate the productivity loss of re-installing Anaconda, particularly a long-standing installation, because it can take 3-4 hours to backup and export existing environment build files as requirements.txt, remove an existing Anaconda installation, clean out the Windows Registry, search the Windows file system for leftover detritus, and then rebuild all of my environments one at a time.
Does anyone know a trick, or have a Python script or some other workaround(s) to refresh the Package Index within a conda environment or for ALL environments created and managed by the Anaconda Navigator GUI. It would be awesome if there was an updater widget within the Anaconda Navigator GUI to allow users to select for which virtual environment(s) they want the package index to be updated.
What I have tried
In the Anaconda Navigator GUI "Environments" tab, clicking on the "Update Index..." button does not get updated with the list of packages installed "behind the scenes" from a Anaconda Command Prompt.
The result I get
pip-installed packages are NOT included in the Anaconda Package Index update process. It does not find packages in environments installed inside and outside of the Anaconda3 root directory. It doesn't even find all packages underneath the \envs folder. This makes me think packages are not installed into the currently selected environments, so it takes time to verify their location in C:\ProgramData\Anaconda3\envs, C:\Users\username\AppData\Local, or elsewhere.
What else I have tried: after having a corrupted Anaconda and Spyder installation that would not start at all, I posted requests for help on various support forums. I got answers that were not much help, like "Just don't mix pip and conda packages, use one or the other". That is not practical since so many Python packages are not available in the conda package format. I have gotten that impractical advice from Anaconda and Spyder developers in the past.
Severity and impact
This is an important issue, since it is possible to use / misuse conda and pip and inadvertently corrupt Anaconda so badly that it requires a painful and time-consuming removal and re-installation of the entire Anaconda distribution.
A possible solution beyond my current cable-tow... If someone can build an intelligent and transparent converter built into the PyPi, Anaconda Cloud, Conda-forge, and other channels that made this conversion automatic and validated, then this conversation might not be needed.

Python Manage Repositories Pycharm

I have recently had to re-download and install Python by using the Anaconda package. This was done because i was having issues installing a few packages and found sources saying it would be easier to simply do it using Anaconda.
I now have the issue that I am unable to upgrade or find new packages (which i used to be able to do, i think it gave the list of all Pypi packages) and am not sure which URL i need to enter in order for PyCharm to find all the packages that it used to. This is what i currently have in the Repositories, As you can see i have already added a few PyPi links, of which none have been successful:
Does anyone know what link needs to be entered here to be able to browse through all PyPi Packages or upgrade currently installed packages?
Under Project Interpreter, there is an Anaconda button. This is a toggle. Turning it off, allows you to use repositories like https://pypi.python.org/simple.
In my configuration i have :
https://pypi.python.org/simple
I've had the same problem after installing Anaconda because of a tkinter problem

Offline Installation of python & pip

I need to install python on a sever to run scripts but the server has no access to the internet.
The server has access to a local network that has access to the internet*. I would like to use pip to manage the packages through a local network directory as specified here.
How can I install pip, python and their dependancies on a windows machine, offline so that I can use pip, as specified in the link above to manage the packages I require?
*For Clarity: I have no ability to mirror, hack or otherwise to get information to pass through the local network directly from the internet.
The official Python installer for Windows has no other dependencies. It runs completely offline.
For other packages that may have dependencies (that are difficult to install on Windows); Christopher Gholke maintains a list of Windows installers for common Python packages. These are msi installers (or whl files) that are self-contained.
They are designed to work with the official Python installer for Windows - as they use its registry entries to identify the install location.
You can download these and move them to your Windows machine.
Beyond those two - if you have further requirements you can use tools like basket to download packages and then provide the location as a source for offline pip installs; or create your own pip repository.
If you do decide to create a local pip repository, it is better to create a pip proxy (see pypicache for example) this way you are only requesting those packages that are required, rather than trying to mirror the entire cheeseshop.

Categories