【问题标题】:PubNub: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneTypePubNub:TypeError:stat:路径应该是字符串、字节、os.PathLike 或整数,而不是 NoneType
【发布时间】:2020-01-31 04:37:12
【问题描述】:

当我尝试使用 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.

感谢您的任何回答

【问题讨论】:

    标签: python pip typeerror pubnub


    【解决方案1】:

    当我使用 PubNub 版本

    pip install pubnub==4.1.7
    

    【讨论】:

    • 很高兴您可以使用它,但最新版本是 v4.3.0。 4.1.7 版本只有几个月大,但从那时起就有quite a few fixes and enhancements。让我们知道 4.3.0 是否正确安装。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-05
    • 1970-01-01
    • 2021-05-04
    • 2021-06-14
    • 1970-01-01
    • 2020-03-25
    • 1970-01-01
    相关资源
    最近更新 更多