How to share modules installed on anaconda with different python versions? - python

I've installed pandas and numpy with anaconda 3.8.8. Is it possible to use this modules in the default Mac python version 3.8.2 or do I have to install them again?
Best,
Dawid

Conda is a different installation than your system Python.
So yes, you'll have to reinstall them (but that's simply pip install numpy pandas, though it'd be a great idea to use virtualenvs).

Related

Can installing two python versions can cause problems?

I've install 3.7.9 and 3.9.7 and installed some packages (including pandas and numpy) but after doing so running or using them in programs some of them are executable in first or second versions of the python how to overcome this ?
Should I just delete any one of the version or there is any remedy for this
You can install multiple python versions without a problem. Whenever you install a package though, it will only be installed into one of the two python versions. You therefore need to install once for python 3.7.9, and once for python 3.9.7. Depending on which OS you are running, you can run the different versions through python3.9 or python3.7. Lets say you want to install pandas on python3.9, you run python3.9 -m pip install pandas.
In general, it is a good idea to use virtual environments (see venv for example). This will install all the dependencies that you have for a project separately. In the long run, such approach will avoid problems with compatibility after upgrading to newer python versions or package versions.

What is the difference between MacPorts py38-pandas and PyPi pandas?

I've just switched to MacBook M1 machine and having trouble installing pandas. I noticed that in addition to PyPi pandas there is a MacPorts py38-pandas package. I could not install the PyPi pandas due to some compilation error but successfully build and installed MacPorts version. However, after installing the py38-pandas I still cannot import pandas in Python3 interpreter.
What is the purpose of these MacPorts Python packages and how are they different? Can I make MacPorts py38-pandas importable in Python 3 interpreter?
I intentionally do not use homebrew.
I have installed python38 via MacPorts and made it available in shell. So, python3 starts Python 3.8 which was installed via MacPorts.
You are using the preinstalled python3, not the MacPorts version.
Perhaps you should read the accepted answer of How to: Macports select python to understand what happens.
Basically you need to set your PATH, that you are using the MacPorts python3 which is usually installed to /opt/local/bin/python3.
This is done by the MacPorts in your $HOME/.profile by adding a line like:
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"

Is there any benefit of using Anaconda for PyCharm?

Is there any benefit of using Anaconda for PyCharm instead of the standard python distribution for PyCharm?
Using Anaconda instead of standard Python will benefit you as Anaconda comes with preinstalled packages. A lot of time will be saved there since installing various packages and making them run gets irritating sometimes.
Also, since it will have preinstalled packages, it can be heavy for your system. You can try miniconda as an alternative where you install packages when required. It is still better than having Python only. You can even install Anaconda by using conda install anaconda
Pip installation of Python packages sometimes may cause few problems to the user and you need to constantly update the pip as well before installing any other python packages via pip. So using Anaconda will be a benefit in this case.

Install Anaconda on Ubuntu with preexisting Python

I have Ubuntu 16.04 LTS with Python 2.7 and 3.5. I've set up virtual environments to access both 2.7 and 3.5 separately and everything works fine.
Now, I need to install Anaconda to access some libraries for a class I am taking. Whats the best way to do this without disrupting the virtual environments I have already set up.
Install Miniconda, a mini version of Anaconda that includes just conda, its dependencies and Python.
https://conda.io/docs/user-guide/install/index.html#installing-conda-on-a-system-that-has-other-python-installations-or-packages
You do not need to uninstall other Python installations or packages in order to use conda. Even if you already have a system Python, another Python installation from a source such as the macOS Homebrew package manager and globally installed packages from pip such as pandas and NumPy, you do not need to uninstall, remove, or change any of them before using conda.
Try using documentation of anaconda as most of the dependencies are untouched while installing it

Installing Numpy developmental over anaconda

I'm pondering switching over to Anaconda from my vanilla Python in OSX. I know Anaconda brings its own NumPy. I was wondering if it was possible to make the GitHub version of NumPy the default version, or if Anaconda only works with its own version.
Anaconda installs python just like it already is on your system, only to a different location. It allows you to choose what packages you want to install. If you want to replace one you can go into the site-packages folder (Anaconda/lib/site-packages) and do so. In my experience, Anaconda was well worth the switch.

Categories

Resources