简体   繁体   中英

Need help installing a specific python package using pip

I have seen related questions to my question, but those answers didn't work for me. I am trying to install xgboost package, but I got this error:

*No files/directories in C:\Users\Fatemeh\AppData\Local\Temp\pip-build-57cpr7io\xgboost\pip-egg-info (from PKG-INFO)*

I have tried almost all the options such as --no-cache-dir , --no-clean but got the same error.

I would appreciate it if you can help me fix this. I tried installing from Github and tried other methods (using cmd and setup.py scripts), but they didn't install the whole package and some of xgboost commands were not working.

I don't have any problem with installing other packages using pip, xgboost is the only one I have problem with installing it.

Here are the scripts that I used accompanied with the output that I got (I have deleted the https:// from all the links):

    C:\Users\Fatemeh\PycharmProjects\AHW1AI>**pip install xgboost**
    Collecting xgboost
      Using cached xgboost-0.4a30.tar.gz
    **No files/directories in C:\Users\Fatemeh\AppData\Local\Temp\pip-build-57cpr7io\xgboost\pip-egg-info (from PKG-INFO)**

    ------------------------------------------------------------------

    C:\Users\Fatemeh\PycharmProjects\AHW1AI>**pip install -v xgboost**
    Collecting xgboost
      1 location(s) to search for versions of xgboost:
      * pypi.python.org/simple/xgboost/
      Getting page pypi.python.org/simple/xgboost/
      Looking up "pypi.python.org/simple/xgboost/" in the cache
      Current age based on date: 206
      Freshness lifetime from max-age: 600
      Freshness lifetime from request max-age: 600
      The response is "fresh", returning cached response
      600 > 206
      Analyzing links from page pypi.python.org/simple/xgboost/
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a12.tar.gz#md5=4d768e034a28590497bb79279f036946 (from pypi.python.org/simple/xgboost/), version: 0.4
    a12
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a13.tar.gz#md5=5f53d51e4305c679192b3cabda2b0dbe (from pypi.python.org/simple/xgboost/), version: 0.4
    a13
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a14.tar.gz#md5=a7c648933a47ae31f869b5c030c17c69 (from pypi.python.org/simple/xgboost/), version: 0.4
    a14
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a15.tar.gz#md5=bcab760af5ac7f20e88bde7426423565 (from pypi.python.org/simple/xgboost/), version: 0.4
    a15
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a18.tar.gz#md5=9f70ca05843afb1d50522530f140d640 (from pypi.python.org/simple/xgboost/), version: 0.4
    a18
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a19.tar.gz#md5=413d55d0534447e77064dbd1ad1ccb48 (from pypi.python.org/simple/xgboost/), version: 0.4
    a19
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a20.tar.gz#md5=88721733e7c7026fa2e95de7165d4b86 (from pypi.python.org/simple/xgboost/), version: 0.4
    a20
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a21.tar.gz#md5=45284beb53f5087e73dcf55ff1c5a026 (from pypi.python.org/simple/xgboost/), version: 0.4
    a21
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a22.tar.gz#md5=cb858cf85fe9f4263e9b523c4900c3f9 (from pypi.python.org/simple/xgboost/), version: 0.4
    a22
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a23.tar.gz#md5=4f8a17ca86995ed51fc1a424618b94db (from pypi.python.org/simple/xgboost/), version: 0.4
    a23
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a24.tar.gz#md5=2bf0edfe62ddb3502c4f48df3428a7e0 (from pypi.python.org/simple/xgboost/), version: 0.4
    a24
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a25.tar.gz#md5=bf3d633fa88ae7923794dd5da0600388 (from pypi.python.org/simple/xgboost/), version: 0.4
    a25
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a26.tar.gz#md5=e5b1f7c477e5238e7b491153449b33b2 (from pypi.python.org/simple/xgboost/), version: 0.4
    a26
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a27.tar.gz#md5=cd091569f651c3c625c4a299cfc72e74 (from pypi.python.org/simple/xgboost/), version: 0.4
    a27
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a28.tar.gz#md5=fd8ffedd172b5cb917483df76e6efe7a (from pypi.python.org/simple/xgboost/), version: 0.4
    a28
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a29.tar.gz#md5=4bf4eb1898cfc28bbd3b43e19c69fdf5 (from pypi.python.org/simple/xgboost/), version: 0.4
    a29
        Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a30.tar.gz#md5=5f4e812ba3a1faa85514993e56c1b4b8 (from pypi.python.org/simple/xgboost/), version: 0.4
    a30
      Using version 0.4a30 (newest of versions: 0.4a12, 0.4a13, 0.4a14, 0.4a15, 0.4a18, 0.4a19, 0.4a20, 0.4a21, 0.4a22, 0.4a23, 0.4a24, 0.4a25, 0.4a26, 0.4a27, 0.4a28, 0.4a29, 0.4a30)
      Looking up "https://pypi.python.org/packages/source/x/xgboost/xgboost-0.4a30.tar.gz" in the cache
      Current age based on date: 714911
      Freshness lifetime from max-age: 31557600
      The response is "fresh", returning cached response
      31557600 > 714911
      Using cached xgboost-0.4a30.tar.gz
      Downloading from URL 
pypi.python.org/packages/source/x/xgboost/xgboost-0.4a30.tar.gz#md5=5f4e812ba3a1faa85514993e56c1b4b8 (from pypi.python.org/simple/xgboost/)
      Running setup.py (path:C:\Users\Fatemeh\AppData\Local\Temp\pip-build-502i197j\xgboost\setup.py) egg_info for package xgboost
        Running command python setup.py egg_info
    **Cleaning up...
    No files/directories in C:\Users\Fatemeh\AppData\Local\Temp\pip-build-502i197j\xgboost\pip-egg-info (from PKG-INFO)**
    Exception information:
    Traceback (most recent call last):
      File "C:\Anaconda3\lib\site-packages\pip\basecommand.py", line 209, in main
        status = self.run(options, args)
      File "C:\Anaconda3\lib\site-packages\pip\commands\install.py", line 310, in run
        wb.build(autobuilding=True)
      File "C:\Anaconda3\lib\site-packages\pip\wheel.py", line 747, in build
        self.requirement_set.prepare_files(self.finder)
      File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 359, in prepare_files
        ignore_dependencies=self.ignore_dependencies))
      File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 590, in _prepare_file
        abstract_dist.prep_for_dist()
      File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 127, in prep_for_dist
        self.req_to_install.run_egg_info()
      File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 457, in run_egg_info
        metadata_name = canonicalize_name(self.pkg_info()["Name"])
      File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 535, in pkg_info
        data = self.egg_info_data('PKG-INFO')
      File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 473, in egg_info_data
        filename = self.egg_info_path(filename)
      File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 517, in egg_info_path
        'No files/directories in %s (from %s)' % (base, filename)
    pip.exceptions.InstallationError: **No files/directories in** **C:\Users\Fatemeh\AppData\Local\Temp\pip-build-502i197j\xgboost\pip-egg-info (from PKG-INFO)**

I think it will work

  1. First download the Wheel file from the given link xgboost 0.90

  2. Then install this library from downloads folder by typing the following command

    python -m pip install downloads/pip-19.1.1-py2.py3-none-any.whl

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