当我尝试使用pip安装PubNub时,出现TypeError:pip install pubnub

追溯:

     Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\phuon\AppData\Local\Temp\pip-install-oti79hk0\cbor2\setup.py", line 52, in <module>
        **kwargs
      File "c:\users\phuon\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\phuon\appdata\local\programs\python\python37\Lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\users\phuon\appdata\local\programs\python\python37\Lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\phuon\appdata\local\programs\python\python37\Lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\phuon\envs\ecommerce\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
        _build_ext.run(self)
      File "c:\users\phuon\appdata\local\programs\python\python37\Lib\distutils\_msvccompiler.py", line 238, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "c:\users\phuon\envs\ecommerce\lib\site-packages\setuptools\msvc.py", line 171, in msvc14_get_vc_env
        return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
      File "c:\users\phuon\envs\ecommerce\lib\site-packages\setuptools\msvc.py", line 1620, in return_env
        if self.vs_ver >= 14 and isfile(self.VCRuntimeRedist):
      File "c:\users\phuon\envs\ecommerce\lib\genericpath.py", line 30, in isfile
        st = os.stat(path)
    TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\phuon\envs\ecommerce\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\phuon\\AppData\\Local\\Temp\\pip-install-oti79hk0\\cbor2\\setup.py'"'"'; __file__='"'"'C:\\Users\\phuon\\AppData\\Local\\Temp\\pip-install-oti79hk0\\cbor2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\phuon\AppData\Local\Temp\pip-record-2pmjwbm8\install-record.txt' --single-version-externally-managed --compile --install-headers
'c:\users\phuon\envs\ecommerce\include\site\python3.7\cbor2' Check the logs for full command output.


谢谢你的回答

最佳答案

当我使用PubNub版本

pip install pubnub==4.1.7

关于python - PubNub:TypeError:stat:路径应为字符串,字节,os.PathLike或整数,而不是NoneType,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/59997926/

10-12 21:58