ImportError: No module named _markerlib (Python安裝第三方庫時出現的錯誤)

當我試着安裝第三方庫時,報錯如下:



(flask) arthur@arthur-CW65S:~/microblog/flask/bin$ pip install --upgrade distribute
Collecting distribute
  Using cached distribute-0.7.3.zip
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/distribute.egg-info
    writing requirements to pip-egg-info/distribute.egg-info/requires.txt
    writing pip-egg-info/distribute.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/distribute.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/distribute.egg-info/dependency_links.txt
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-s1lK7B/distribute/setup.py", line 58, in <module>
        setuptools.setup(**setup_params)
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "setuptools/command/egg_info.py", line 177, in run
        writer = ep.load(installer=installer)
      File "pkg_resources.py", line 2241, in load
        if require: self.require(env, installer)
      File "pkg_resources.py", line 2254, in require
        working_set.resolve(self.dist.requires(self.extras),env,installer)))
      File "pkg_resources.py", line 2471, in requires
        dm = self._dep_map
      File "pkg_resources.py", line 2682, in _dep_map
        self.__dep_map = self._compute_dependencies()
      File "pkg_resources.py", line 2699, in _compute_dependencies
        from _markerlib import compile as compile_marker
    ImportError: No module named _markerlib
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-s1lK7B/distribute/

於是我一頓操作就OK

按照如下操作

easy_install distribute
pip install --upgrade distribute
然後OK
(flask) arthur@arthur-CW65S:~/microblog/flask/bin$ easy_install distribute
Searching for distribute
Reading https://pypi.python.org/simple/distribute/
Downloading https://pypi.python.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip#md5=c6c59594a7b180af57af8a0cc0cf5b4a
Best match: distribute 0.7.3
Processing distribute-0.7.3.zip
Writing /tmp/easy_install-E4tI5M/distribute-0.7.3/setup.cfg
Running distribute-0.7.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-E4tI5M/distribute-0.7.3/egg-dist-tmp-FmvjVF
warning: install_lib: 'build/lib.linux-x86_64-2.7' does not exist -- no Python modules to install

Moving distribute-0.7.3-py2.7.egg to /home/arthur/microblog/flask/lib/python2.7/site-packages
Adding distribute 0.7.3 to easy-install.pth file

Installed /home/arthur/microblog/flask/lib/python2.7/site-packages/distribute-0.7.3-py2.7.egg
Processing dependencies for distribute
Finished processing dependencies for distribute
(flask) arthur@arthur-CW65S:~/microblog/flask/bin$ pip install --upgrate distribute

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: --upgrate
(flask) arthur@arthur-CW65S:~/microblog/flask/bin$ pip install --upgrade distribute
Requirement already up-to-date: distribute in /home/arthur/microblog/flask/lib/python2.7/site-packages/distribute-0.7.3-py2.7.egg
Collecting setuptools>=0.7 (from distribute)
  Using cached setuptools-39.0.0-py2.py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 33.1.1
    Uninstalling setuptools-33.1.1:
      Successfully uninstalled setuptools-33.1.1
Successfully installed setuptools-39.0.0
(flask) arthur@arthur-CW65S:~/microblog/flask/bin$ pip install dotenv
Collecting dotenv
  Using cached dotenv-0.0.5.tar.gz
Building wheels for collected packages: dotenv
  Running setup.py bdist_wheel for dotenv ... done
  Stored in directory: /home/arthur/.cache/pip/wheels/14/3f/3c/9074f3f9b59fca233c475b9a2052675c244eb876ff70f93209
Successfully built dotenv
Installing collected packages: dotenv
Successfully installed dotenv-0.0.5

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章