简体   繁体   中英

Can't install pyspark on PyCharm

I am trying to install pyspark on PyCharm but I end up with the following error:

Collecting pyspark
  Using cached https://files.pythonhosted.org/packages/37/98/244399c0daa7894cdf387e7007d5e8b3710a79b67f3fd991c0b0b644822d/pyspark-2.4.3.tar.gz

    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Could not import pypandoc - required to package PySpark
    Download error on https://pypi.org/simple/pypandoc/: [Errno 60] Operation timed out -- Some packages may not be found!
    Couldn't find index page for 'pypandoc' (maybe misspelled?)
    Download error on https://pypi.org/simple/: [Errno 60] Operation timed out -- Some packages may not be found!
    No local packages or working download links found for pypandoc
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/m6/x3v1x7255lv_w_vsp0zz_jw8hvmgc7/T/pycharm-packaging/pyspark/setup.py", line 224, in <module>
        'Programming Language :: Python :: Implementation :: PyPy']
      File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pypandoc')
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/m6/x3v1x7255lv_w_vsp0zz_jw8hvmgc7/T/pycharm-packaging/pyspark/

I've tried to install it through Preferences -> Project Interpreter -> Click on the '+' -> search for pyspark -> click install package

Relevant packages already installed:

pip v19.1.1 (latest) setuptools v41.0.1 (latest) ez-setup v0.9 (latest)

Note that I am able to install other packages.

Can someone shed some light here?

As the error indicates:

No local packages or working download links found for pypandoc

You should first install pypandoc and then try to install pyspark package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM