No module named 'fbprophet'? - python

I have tried to install Facebook Prophet in Anaconda on Ubuntu following the instructions at:
https://facebook.github.io/prophet/docs/installation.html#installation-in-python.
In Anaconda Navigator, when I click on the environment, fbprophet is listed along with the other installed packages. The problem is that when I try to use fbprophet in Jupyter:
from fbprophet import Prophet
I get an error: "ModuleNotFoundError: No module named 'fbprophet'". It's bizarre because the fbprophet package seems to be installed in my environment according to Anaconda.
Can anyone help, please?
Thanks!

It seems that you have installed the package in a separate environment in anaconda. I think when you are running jupyter notebook, it is running from the base environment, But actually you need to run it from the library environment. So if the case is this you need to install jupyter notebook in the other environment and then run the jypyter notebook from that environment. So at first make sure that you have installed jupyter notebook correctly on the appropriate environment. If you have installed it correctly then open jupyter notebook and in a code cell write the following commands and execute the cell.
First, execute this command in a code cell-
!conda install -c conda-forge fbprophet -y
Then in another code cell execute this command-
!pip install --upgrade plotly
Now try to import the library.

Recently the fbprophet project renamed to prophet.
If you are referring to it using old name you should install the old version.
pip/conda/mamba/whatever install prophet

After spending hours scouring the internet for answers to this question and similar questions like "ERROR: Command errored out with exit status 1: when installing "Facebook" "prophet"" what worked for me was quite simply using a sudo pip install at the terminal prompt:
$ sudo pip install pystan==2.19.1.1 prophet
After install using prophet instead of fbprophet:
from prophet import Prophet
Credit to GitHub issue 1874 - https://github.com/facebook/prophet/issues/1874

Window10 + Pycharm.
This works with Python 3.8. and Python 3.9.x:
pip install localpip
localpip install fbprophet

Related

non-installed packages work when trying to import them in jupyter notebook

I need some help with some weird things happening in jupyter.
It all started when I was trying to install tweepy, the package was installed successfully but it doesn't work when I try to import it in jupyter and it outputs this error:
ImportError: No module named 'tweepy'
The package was installed via pip, first thing I checked was if the package was really installed in the environment or not..and it was. In short I tried the following:
I uninstalled the package with pip uninstall tweepy and then installed it again with pip install tweepy.
I then tried to install it with conda install -c conda-forge tweepy
I then tried to install it from inside the notebook with !conda install -y -c conda-forge tweepy
Well..nothing from the above did work, unfortunately. and it was getting really frustrating!
I found this post which suggest this:
import sys
!{sys.executable} -m pip install package
It did work. but here is the weird thing: whatever package I import ,even non-installed packages!, the cell just work without any errors! and when I check the list of packages installed in a totally new environment that I created to test this, which does not have any packages installed, with !conda list I get empty list as expected but still any package I import still work!
So, can anyone help me understand what just happened?
You should not use pip if you are using Anaconda. Create a virtual environment by typing: conda create -n yourenvname python=x.x anaconda where yourenvname is the name of your virtual environment and python=x.x is the version number of python you wish to use like python=3.8. Now after this activate you virtual environment. The type conda install package. And see if it works.

Problems installing astra toolbox in Python

I'm trying to install astra-toolbox for python on windows and I'm getting this error.
Anyone have any ideas?
i have tried to install via pip method but it's not working facing the same error as you. if you go to official installation documentation instructions no method to use pip method is given.
i have anaconda installed in my system so i have tried using these commands source:
conda install -c astra-toolbox astra-toolbox
conda install -c astra-toolbox/label/dev astra-toolbox
this solve the issue and astra-toolbox is installed in my system.
PS. this will downgrade package in anaconda. so better to install in separate python environment.

problem while installing python package in spyder

I'm trying to install python library called "librosa" in spyder anaconda.
I tried conda install -c conda-forge librosa from here to install package.
This was result in anaconda shell.
But when I try to import librosa in spyder, it gives error.
How to fix this?
Thank you!

Not able to update the version of tensorflow

I am facing the below error while running the code for LinearClassifier in tensorflow.
AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'LinearRegressor'
My current version for tensorflow is 1.2.1. I tried to update the version of the package from ANACONDA environment, its not showing for an upgrade.
I tried to upgrade it from command prompt by using below command, it is successfully updating the package however it is not reflecting to the actual library when I am using it.
pip install --upgrade tensorflow==1.3.0
FYI, I am using Jupyter Notebook and have created a separate environment for tensorflow.
Please let me know if I have missed anything.
If your command pip install --upgrade tensorflowcompiles, then your version of tensorflow should be the newest. However you should restart your notebook. Also, as you said that you are using anaconda. You can also install and upgrade tensorflow as follows:
conda install -c conda-forge tensorflow # to install
conda upgrade -c conda-forge tensorflow # to upgrade
That should work. Check if you are using any environment but you are not updating the tensorflow version within the environment.
Also, please restart the notebook after saving it and run the cells and try. That should work.
Verify in the notebook : run - print(tf.__version__). Please mark the answer if it resolves.

Can't install wordcloud in python (Anaconda)

I am trying to install wordcloud in my python program. I am doing the following steps. Please tell me where i am doing wrong-
I downloaded the wordcloud package from here https://github.com/amueller/word_cloud
Copy and paste it in the Anaconda3 folder.
Open Anaconda command prompt and give the following command "pip install wordcloud".
The following error is showing -
Please let me know what to do.
You can simply use conda package manager to install wordcloud, just run:
conda install -c https://conda.anaconda.org/conda-forge wordcloud
There is a new version available now but this one worked for me
With Anaconda python 3.6
download from this link.
wordcloud 1.3.2‑cp36‑cp36m‑win_amd64.whl
Then don't extract the file, copy and paste the dir in cmd.
Use this command pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl
Open JupyterLab from Anaconda dashboard, in terminal 1, run:
conda install -c conda-forge wordcloud
Source: link
It is trying to build Word Cloud using Visual Studio. If you don't have it you can get a subset called "Microsoft Build Tools 2015" here: https://www.microsoft.com/en-us/download/details.aspx?id=48159
Even having a full version of Visual Studio 2015 and my path set up properly I still had trouble installing using pip. I also had no luck with the conda installer. The following worked for me:
Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud and download the wheel for the version of Word Cloud you need.
From the command prompt install using pip. For example, pip install wordcloud-1.2.1-cp27-cp27m-win_amd64.whl
Using Anaconda Python 3.6 version For Windows you can do it as:
Installation of wordcloud package
download wordcloud‑1.3.2‑cp36‑cp36m‑win_amd64.whl from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud
Copy the file to your current working directory
Open command prompt
python -m pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl
I have python 3.6.3 installed on my windows system. I installed wordcloud package in python but faced the "wordcloud No Module Found" error on Anaconda Jupyter Notebook.
I tried most of the solutions posted here but nothing worked for me.
Finally I installed wordcloud package in the Scripts directory under Anacond3 directory in the command prompt using:
pip install wordcloud
This worked and I am able to import wordcloud on Jupyter now.
I've got the similar error but related to certification, if the error is:
Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify
failed\')])",),))',),)
This other SO question helped me. It basically said to do:
conda config --set ssl_verify false
After a long try:
1) Download the latest version of WordCloud from this link.
2) Copy it into the Script directory under Anaconda3.
3) Open the command prompt and do pip install wordcloud. (If a win[5] authorization error occurs, try doing pip from the admin command prompt or sudo pip install wordcloud.)
You should have a virtual environment for each project or group of projects that use a particular set of packages. I use Anaconda. Jupyter should be installed in each of your virtual environments. Let's assume you've already created the environment foo. Then:
conda activate foo
conda install jupyter
conda install -c conda-forge wordcloud
Now when you do the import it should work. My import:
from wordcloud import WordCloud, STOPWORDS
I'm working through How to Generate a Word Cloud of Any Shape in Python
Installing wordcloud using Anaconda
Latest version of wordcloud : 1.8.1
Python version supporting wordcloud=1.8.1 : 2.7, 3.4, 3.5, 3.6 and 3.7
Installation of wordcloud using Anaconda, you can install from the conda-forge channel:
conda install -c conda-forge wordcloud
Wordcloud installation problem :
Note: If you are facing issues installing wordcloud on Windows10. The follow the below procedure.
Go to: https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud
Click on the matching whl file to download.
Naming: wordcloud-[version]-cp [python-version]-cp [python-version]-win [32bit-or-64bit].whl
Then below command in command prompt
pip install <location_of_wordcloud_whl_file>
Example:
pip install "C:\Users\Testuser\Desktop\wordcloud-1.6.0-cp38-cp38-win32.whl"

Categories