简体   繁体   中英

Error when installing dmgbuild with pip.

I am trying to install dmgbuild with pip and I receive the error below:

AttributeError: 'str' object has no attribute 'decode'
  • Windows 10
  • Command Prompt (Admin)
  • pip version 9.0.1

    C:>pip install dmgbuild Collecting dmgbuild Using cached dmgbuild-1.3.0.tar.gz Collecting ds_store>=1.1.0 (from dmgbuild) Using cached ds_store-1.1.0.tar.gz Collecting mac_alias>=2.0.1 (from dmgbuild) Using cached mac_alias-2.0.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "C:\\Users\\rpanczer\\AppData\\Local\\Temp\\pip-build-gvy3qj3a\\mac-alias\\setup.py", line 5, in longdesc = f.read().decode('utf-8') AttributeError: 'str' object has no attribute 'decode'

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

    Command "python setup.py egg_info" failed with error code 1 in C:\\Users\\rpanczer\\AppData\\Local\\Temp\\pip-build-gvy3qj3a\\mac-alias\\

str.decode no longer exists in python 3.x

The error is due to mac_alias , which dmgbuild depends on,is not compatible to python 3 somehow.

You can check out mac_alias homepage.

I just tested everything is okay if you are using python 2.7.

Try to specify your python interpreter firstly before writing commands, this may help you in the case you have more than one version installed.

C:\ python3 pip install dmgbuild

Also try to use -m command in addition to pip install, it provides root access to python command prompt.

C:\ python3 -m pip install dmgbuild

In case neither of the methods above works for you, check if your python interpreter is already added the PATH variable.

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