Unable to Install FB Prophet Using Conda (Mac OS) - python

I am trying to install FB's Prophet package to use in Jupyter, which I launch via Anaconda, however I am getting errors with each attempt. I started on FB's Git page and used 'conda install -c conda-forge prophet', however, I continuously get an error that I need to manually a series of files (hijri, ephem, lunarcalendar, etc.). I have researched as many links as I could, including this long exchange on GitHub, but have been unable to find a solution. In my more recent attempts to install Prophet I am just getting a continuous loop of "Solving environment".
I am a relatively new user to Anaconda and not intimately familiar with interacting in Terminal. If anyone can offer insights into what I could be doing differently it would be greatly appreciated.
Please let me know if I can provide any more details. Thank you.

It's always best to create a new environment rather than installing new packages into the base environment - the base env already contains lots of packages so you are liable to hit lots of dependency problems if you introduce anything new as conda tries to figure out what version of every package will be compatible with all the others.
To create a new env called myenv in which you want to use the packages prophet and jupyter (and all their dependencies), and getting the packages from the conda-forge channel, do:
conda create -n myenv -c conda-forge prophet jupyter
To use Jupyter in this environment, just activate the env before starting Jupyter:
conda activate myenv
jupyter notebook
For more information about working with conda environments, see the documentation

Related

How to import modules into Jupyter Notebook kernel

I am having problems installing modules and then importing them into specific Jupyter Notebook kernels. I want to install them directly into the kernel as opposed to throughout anaconda to separate dependencies in projects. Here is how the problem goes:
I firstly want a package, for example, nltk
I navigate to and activate the conda environment (called python3) and run 'conda install nltk'
I then load that environment into Jupyter using ipykernel with the command 'python -m ipykernel install --user --name python3'
When trying to import the package into the notebook it tells me that it cannot be found
I have been struggling with this for a while. Where am I going wrong? I greatly appreciate all the help.
NOTE: I have somehow managed to install and import many packages into notebooks using the aforementioned process. I'd really like a method to do this in a foolproof manner.
Not entirely clear where things go wrong, but perhaps clarifying some of the terminology could help:
"navigate to...the conda environment" - navigating has zero effect on anything. Most end-users should never enter or directly write to any environment directories.
"...and activate the conda environment" - activation is unnecessary - a more robust installation command is always to use a -n,--name argument:
conda install -n python3 nltk
This is more robust because it is not context-sensitive, i.e., it doesn't matter what (if any) environment is currently activated.
"load that environment into Jupyter using ipykernel" - that command registers the environment as a kernel at a user-level. That only ever needs to be run once per kernel - not after each new package installation. Loading the kernel happens when you are creating (or changing the settings of) a notebook. That is, you choose the kernel in the Jupyter GUI.
Even better, keep jupyter in a dedicated environment with an installation of nb_conda_kernels and Jupyter (launched from that dedicated environment) will auto-discover all Conda environments that have valid kernels installed (e.g., ipykernel, r-irkernel).

I am not able to install pytorch in jupyter and Spyder?

I have tried installing pytorch on jupyter and spyder but it is not working. I have install it in conda env, from pytorch documentation tried everything.
From pytorch documentation and it shows pytorch installed 100%
In conda env. Installed for jupyter and spyder
In conda list pytorch is not showing
I have tried to open from app after installing in conda env. But it is Not opening here in jupyter, a pop up window appears each time for 1-2 seconds then disappears.
Is there any other way to install it ?? Please help
Your issue is simply that conda fails to install pytorch; this can have multiple causes. Forget about spyder and jupyter, they're not the issue.
1. From pytorch documentation and it shows pytorch installed 100%
No it doesn't. Look at the bottom line: Rolling back transaction: ...working... done. conda did not successfully install the package. You need to debug further why (permissions issue on directory? installing under userid? dependency conflict?) Follow my suggestions at bottom.
2. In conda env. Installed for jupyter and spyder
No they don't! They only show that conda has (previously) installed the jupyter and spyder executables. Those don't tell you which conda packages are installed. That's what conda list does.
3. In conda list pytorch is not showing
Correct. Because it never installed it in the first place, as per 1. above.
You must debug why step 1. fails. There are many possible causes and you haven't given enough debugging information that we can tell which.
Please post extra information on why it fails. Suggest you do the following:
Try just conda install pytorch -c pytorch by itself, not all the other packages, they make constraint solving harder.
Try verbose mode: conda install -v pytorch -c pytorch
verbose mode should show you why conda thinks it needs to roll back the transaction (e.g. conflicting dependencies for 2+ different packages)
Check which user and permissions you're doing conda install under, are they the same as the Anaconda install? (often if you use the GUI installer under Windows/Linux/Mac, it assumes it can/should as admin or else user, without asking you).
In rare cases, you might need to nuke your conda environment and create a new env. I'd do this if you can't debug it after say 48+ hours. If you install every package under 'base', in particular for R as well as Python, this is a known issue. Even if doesn't break things, using 'base' environment for too many things tends to slow down constraint solving to take many hours, or hang forever.
Finally, after you do finally get the package installed, see if you need to set PYTHONPATH (either/both inside the Anaconda GUI package manager, and in the Unix shell .bashrc/Windows environment settings).
See the anaconda doc and also SO and the many good third-party blogs out there.

Anaconda conda env create -f tfdl_env.yml (solving envirnoment: failed)

I'm currently starting udemy's Guide to tensoflow course. And it's required to type 'conda env create -f tfdl_env.yml' on the command line after using cd to get to the unziped file 'Tensorflow-Bootcamp-master'.
But after doing so this poped off: 'Solving environment: failed' (I'm on windows btw and have just installed anaconda)
I've been searching for solutions but didn't find anyhting. Is there a solution to this problem?
link to the picture of the command line
Solving environment can sometimes failed in conda, that is why, especially for machine learning libraries (I use it for everything though). Try to install every package using
conda install -c packagename conda-forge
That may take some time, but for me it was usually the solution
Sorry there may be some confusion.
Create environment of the name you want, without any specific packages
Activate environment conda activate env_name
Install all packages using forge

Lasagne package issue

In Conda prompt it shows resolving metadata and then in the solving environment it takes lots of time & shows error saying it couldn't perform by frozen method so tries for dynamic pan but still not executed.
How can I install the lasagne package in Anaconda?
This is most likely a Python version issue. The Lasagne Python package has not been updated in a few years, and therefore the only versions of Python it is compatible with are 2.7, 3.4, and 3.5 (see available files on Anaconda Cloud). Any relatively recent installations of Anaconda are likely not using any of these versions and changing the Python version in your base env is not recommended - hence why it likely fails to solve. Instead, create a new environment specifically for Lasagne, e.g.,
conda create -n my_lasagne_env lasagne
Then you can use this env with conda activate my_lasagne_env.
Generally, the best practice in Conda is to create a new environment for each project or project type, and minimize updating or adding new packages after you have the packages required for the development project. This includes not avoiding making changes to your base env, aside from the occasional conda update conda to make sure the package manager itself stays up to date.
To install this package with conda run:
conda install -c toli lasagne
Solving environment look at Here
If not you can find solution : https://github.com/conda/conda/issues/7690

Can run Tensorflow within conda env, but then cannot access other anacona modules (matplotlib, pandas etc)

I have created a conda environment named tensorflow, and installed tensorflow within this environment following the official install guide (https://www.tensorflow.org/install/install_linux#installing_with_anaconda)
When I activate the virtual environment I can import tensorflow, but cannot import other modules from anaconda such as pandas or matplotlib.
Do I need to re-install all the modules that I want again within the tensorflow environment?
If so, should I use conda rather than pip to install them?
Is there an easier way to do this?
Thanks for the help, I'm quite new to virtual environments.
I had the same issue, and I solved it by following steps (on mac):
(1) go to Anaconda Navigator (I installed Python via Anaconda)
(2) create a new environment called tensorflow;
- See this video for detailed steps
- I had issues with creating a new environment and solved it thanks to this post ("conda update conda")
(3) under "Environment", select the new "tensorflow" environment; on the right panel, filter "Not installed", search and install the missing modules
(4) Stay in Tensorflow environment - Go to "Home", install and launch jupyter notebook
(5) Go to jupyter and try import both tensorflow and any previously missing modules - should work this time.
You can either install the required packages manually by using conda or pip, or if you want to install all the packages that come by default you can use
conda install anaconda
Note this will download files of size more than 300MB.

Categories

Resources