prophet: Command "python setup.py egg_info" failed with error code 1

When I run $ pip install fbprophet on Python 2.7.13, macOS 10.12.4, I get the following error:

Collecting fbprophet
  Using cached fbprophet-0.1.post1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/v9/5n8070c96854w3mhd9knc73w0000gn/T/pip-build-zZTmYY/fbprophet/setup.py", line 96, in <module>
        """
      File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/setuptools/dist.py", line 318, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/setuptools/dist.py", line 373, in fetch_build_eggs
        replace_conflicting=True,
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/pkg_resources/__init__.py", line 851, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1123, in best_match
        return self.obtain(req, installer)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1135, in obtain
        return installer(requirement)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/setuptools/dist.py", line 441, in fetch_build_egg
        return cmd.easy_install(req)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 674, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 700, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 881, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1120, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/Users/skurilyak/Envs/prophet/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1108, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with Cython>=0.22 and NumPy are required.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/v9/5n8070c96854w3mhd9knc73w0000gn/T/pip-build-zZTmYY/fbprophet/

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 39

Most upvoted comments

I fixed the issue by typing:

$ pip install pystan
$ python setup.py install

I solved this by using this below command.

sudo apt-get install libmysqlclient-dev

I got hit with the same issue, your first command was successful, however when running the second command I get the following:

Blakes-MacBook-Pro:~ bmc$ sudo python setup.py install /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can’t open file ‘setup.py’: [Errno 2] No such file or directory

screen shot 2017-04-17 at 7 42 59 pm

I solved it by: pip install --upgrade setuptools

I have tried everything above and still get the error

how about for mac?

apt install -y libmysqlclient-dev helped on Ubuntu 16 LTS

Try: pip install --upgrade setuptools Worked for me.

I solved this problem by running pip install --upgrade pip

I use ubuntu and this worked for me. pip install mysqlclient

Still stuck with this error even after trying everything mentioned on this post. Anyone found any solution?

capture I’ve tried almost everything to fix it , anyone can help ? Thanks in advance.

brew install mysql-connector-c brew install mysql brew unlink mysql-connector-c sudo pip install pymysql sudo pip install mysqlclient

Try these in this order

I have tried all the methods mentioned inthis post but nothing has worked.

Sumit-macbook:~ admin$ sudo -s bash-3.2# sudo apt-get install python3.6-dev libmysqlclient-dev sudo: apt-get: command not found bash-3.2#

After a lot of tinkering, a quick sudo apt-cache search mysqlclient hinted that I needed to install default-libmysqlclient-dev with: sudo apt-get install default-libmysqlclient-dev

I did absolutely everything and it got fixed. Here are the commands I entered last

  • pip install psycopg2-binary
  • conda install py-xgboost
  • pip3 install --user --upgrade pip setuptools wheel
  • pip install shapely
  • pip3 install minepy
  • pip install --upgrade pip
  • pip install --upgrade setuptools
  • pip install mysqlclient
  • pip install pystan
  • pip install matplotlib

error i try all most every think but give error

@MahrezBH Oh god you saved my life.

sudo -s and then python3 -m pip install flask-mysqldb worked for me.

sudo apt-get install python-xlib

test this solution