gpt4 book ai didi

python-3.x - 使用python setup.py install时InstaPy安装报错

转载 作者:行者123 更新时间:2023-12-05 07:29:26 27 4
gpt4 key购买 nike

我目前使用的是 Python 3.6.3 |Anaconda 定制版(64 位),我的 pip 版本是 18.1。

我正在按照 GitHub 中的基本安装步骤安装 InstaPy 但无法完成第 3 步:( https://github.com/timgrossmann/InstaPy#basic-installation )

  1. git 克隆 https://github.com/timgrossmann/InstaPy.git
  2. CD InstaPy
  3. pip 安装。或者 python setup.py 安装
  4. 从这里为您的系统下载 chromedriver。提取 .zip 文件并

将其放入/assets 文件夹中。

但是,我无法进行第 3 步。

  • 如果我执行“pip install”,那么我将得到“'pip' 未被识别为内部或外部命令、可运行程序或批处理文件。”因为我会得到“‘pip’不被识别为内部或外部命令”
  • 如果我使用 pip.exe 所在的目录执行 pip install InstaPy,我会得到“要求已经满足:InstaPy in c:\programdata\anaconda3\lib\site-packages (0.1.dev0)”。这可能是因为我之前尝试使用“pip install InstaPy”安装 InstaPy。 (现在,当我在 python 中“从 instapy 导入 InstaPy”时收到错误消息)
  • 如果我执行“python setup.py install”,我将收到以下大量错误消息。

    C:\ProgramData\Anaconda3\Scripts\InstaPy>python setup.py install
    C:\ProgramData\Anaconda3\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'project_urls'
    warnings.warn(msg)
    running install
    running bdist_egg
    running egg_info
    writing instagram_py.egg-info\PKG-INFO
    writing dependency_links to instagram_py.egg-info\dependency_links.txt
    writing requirements to instagram_py.egg-info\requires.txt
    writing top-level names to instagram_py.egg-info\top_level.txt
    file i.py (for module i) not found
    file n.py (for module n) not found
    file s.py (for module s) not found
    file t.py (for module t) not found
    file a.py (for module a) not found
    file p.py (for module p) not found
    file y.py (for module y) not found
    reading manifest file 'instagram_py.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*' under directory 'db'
    writing manifest file 'instagram_py.egg-info\SOURCES.txt'
    installing library code to build\bdist.win-amd64\egg
    running install_lib
    running build_py
    file i.py (for module i) not found
    file n.py (for module n) not found
    file s.py (for module s) not found
    file t.py (for module t) not found
    file a.py (for module a) not found
    file p.py (for module p) not found
    file y.py (for module y) not found
    file i.py (for module i) not found
    file n.py (for module n) not found
    file s.py (for module s) not found
    file t.py (for module t) not found
    file a.py (for module a) not found
    file p.py (for module p) not found
    file y.py (for module y) not found
    creating build\bdist.win-amd64\egg
    creating build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\clarifai_util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\commenters_util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\comment_util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\database_engine.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\feed_util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\instapy.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\like_util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\login_util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\monkey_patcher.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\print_log_writer.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\quota_supervisor.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\relationship_tools.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\settings.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\time_util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\unfollow_util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\util.py -> build\bdist.win-amd64\egg\instapy
    copying build\lib\instapy\__init__.py -> build\bdist.win-amd64\egg\instapy
    byte-compiling build\bdist.win-amd64\egg\instapy\clarifai_util.py to clarifai_util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\commenters_util.py to commenters_util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\comment_util.py to comment_util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\database_engine.py to database_engine.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\feed_util.py to feed_util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\instapy.py to instapy.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\like_util.py to like_util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\login_util.py to login_util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\monkey_patcher.py to monkey_patcher.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\print_log_writer.py to print_log_writer.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\quota_supervisor.py to quota_supervisor.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\relationship_tools.py to relationship_tools.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\settings.py to settings.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\time_util.py to time_util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\unfollow_util.py to unfollow_util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\util.py to util.cpython-36.pyc
    byte-compiling build\bdist.win-amd64\egg\instapy\__init__.py to __init__.cpython-36.pyc
    creating build\bdist.win-amd64\egg\EGG-INFO
    copying instagram_py.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
    copying instagram_py.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
    copying instagram_py.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
    copying instagram_py.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
    copying instagram_py.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
    zip_safe flag not set; analyzing archive contents...
    instapy.__pycache__.settings.cpython-36: module references __file__
    creating 'dist\instagram_py-0.0.1-py3.6.egg' and adding 'build\bdist.win-amd64\egg' to it
    removing 'build\bdist.win-amd64\egg' (and everything under it)
    Processing instagram_py-0.0.1-py3.6.egg
    removing 'c:\programdata\anaconda3\lib\site-packages\instagram_py-0.0.1-py3.6.egg' (and everything under it)
    creating c:\programdata\anaconda3\lib\site-packages\instagram_py-0.0.1-py3.6.egg
    Extracting instagram_py-0.0.1-py3.6.egg to c:\programdata\anaconda3\lib\site-packages
    instagram-py 0.0.1 is already the active version in easy-install.pth

    Installed c:\programdata\anaconda3\lib\site-packages\instagram_py-0.0.1-py3.6.egg
    Processing dependencies for instagram-py==0.0.1
    Searching for grpcio<2,>=1.13.0
    Reading https://pypi.python.org/simple/grpcio/
    Downloading https://files.pythonhosted.org/packages/f3/24/53e18e2c95b46bdb364019e78b96187e263c79166bfee44be9e2554307a4/grpcio-1.16.0rc1.tar.gz#sha256=fc3ae6a062dfc1dee9dae524164bd1bb1f61929b1d3f0727ac889e08b0979702
    Best match: grpcio 1.16.0rc1
    Processing grpcio-1.16.0rc1.tar.gz
    Writing C:\Users\username\AppData\Local\Temp\easy_install-kylgce_3\grpcio-1.16.0rc1\setup.cfg
    Running grpcio-1.16.0rc1\setup.py -q bdist_egg --dist-dir C:\Users\username\AppData\Local\Temp\easy_install-kylgce_3\grpcio-1.16.0rc1\egg-dist-tmp-aw1tcwnv
    Found cython-generated files...
    warning: no files found matching '*.c' under directory 'src\python\grpcio\grpc'
    warning: no files found matching '*.h' under directory 'src\python\grpcio\grpc'
    warning: no files found matching '*.python' under directory 'src\python\grpcio\grpc'
    warning: no previously-included files matching '*.so' found under directory 'src\python\grpcio\grpc\_cython'
    warning: no previously-included files matching '*.pyd' found under directory 'src\python\grpcio\grpc\_cython'
    warning: no files found matching 'src\python\grpcio\precompiled.py'
    Found cython-generated files...
    cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
    cygrpc.cpp
    c:\programdata\anaconda3\include\pyconfig.h(119): warning C4005: 'MS_WIN64': macro redefinition
    c:\programdata\anaconda3\include\pyconfig.h(119): note: command-line arguments: see previous definition of 'MS_WIN64'
    .\src/core/lib/iomgr/gevent_util.h(43): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
    src\python\grpcio\grpc/_cython/cygrpc.cpp(1365): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory
    a.c
    Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 423, in compile
    self.spawn(args)
    File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 542, in spawn
    return super().spawn(cmd)
    File "C:\Users\username\AppData\Local\Temp\easy_install-kylgce_3\grpcio-1.16.0rc1\src\python\grpcio\_spawn_patch.py", line 54, in _commandfile_spawn
    File "C:\ProgramData\Anaconda3\lib\distutils\ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
    File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 38, in spawn
    _spawn_nt(cmd, search_path, dry_run=dry_run)
    File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 81, in _spawn_nt
    "command %r failed with exit status %d" % (cmd, rc))
    distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\username\AppData\Local\Temp\easy_install-kylgce_3\grpcio-1.16.0rc1\src\python\grpcio\commands.py", line 301, in build_extensions
    File "C:\ProgramData\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 193, in build_extensions
    self.build_extension(ext)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
    File "C:\ProgramData\Anaconda3\lib\distutils\command\build_ext.py", line 533, in build_extension
    depends=ext.depends)
    File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 425, in compile
    raise CompileError(msg)
    distutils.errors.CompileError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\sandbox.py", line 158, in save_modules
    yield saved
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\sandbox.py", line 199, in setup_context
    yield
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\sandbox.py", line 254, in run_setup
    _execfile(setup_script, ns)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\sandbox.py", line 49, in _execfile
    exec(code, globals, locals)
    File "C:\Users\username\AppData\Local\Temp\easy_install-kylgce_3\grpcio-1.16.0rc1\setup.py", line 348, in <module>
    File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
    File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
    File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\bdist_egg.py", line 169, in run
    cmd = self.call_command('install_lib', warn_dir=0)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\bdist_egg.py", line 155, in call_command
    self.run_command(cmdname)
    File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
    File "C:\ProgramData\Anaconda3\lib\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
    File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 75, in run
    _build_ext.run(self)
    File "C:\ProgramData\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 185, in run
    _build_ext.build_ext.run(self)
    File "C:\ProgramData\Anaconda3\lib\distutils\command\build_ext.py", line 339, in run
    self.build_extensions()
    File "C:\Users\username\AppData\Local\Temp\easy_install-kylgce_3\grpcio-1.16.0rc1\src\python\grpcio\commands.py", line 306, in build_extensions
    commands.CommandError: Failed `build_ext` step:
    Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 423, in compile
    self.spawn(args)
    File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 542, in spawn
    return super().spawn(cmd)
    File "C:\Users\username\AppData\Local\Temp\easy_install-kylgce_3\grpcio-1.16.0rc1\src\python\grpcio\_spawn_patch.py", line 54, in _commandfile_spawn
    _classic_spawn(self, command)
    File "C:\ProgramData\Anaconda3\lib\distutils\ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
    File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 38, in spawn
    _spawn_nt(cmd, search_path, dry_run=dry_run)
    File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 81, in _spawn_nt
    "command %r failed with exit status %d" % (cmd, rc))
    distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\username\AppData\Local\Temp\easy_install-kylgce_3\grpcio-1.16.0rc1\src\python\grpcio\commands.py", line 301, in build_extensions
    build_ext.build_ext.build_extensions(self)
    File "C:\ProgramData\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 193, in build_extensions
    self.build_extension(ext)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
    File "C:\ProgramData\Anaconda3\lib\distutils\command\build_ext.py", line 533, in build_extension
    depends=ext.depends)
    File "C:\ProgramData\Anaconda3\lib\distutils\_msvccompiler.py", line 425, in compile
    raise CompileError(msg)
    distutils.errors.CompileError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2


    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "setup.py", line 65, in <module>
    platforms=["win32", "linux", "linux2", "darwin"]
    File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
    File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
    File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 117, in do_egg_install
    cmd.run()
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 411, in run
    self.easy_install(spec, not self.no_deps)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 653, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 700, in install_item
    self.process_distribution(spec, dist, deps)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 745, in process_distribution
    [requirement], self.local_index, self.easy_install
    File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 863, in resolve
    replace_conflicting=replace_conflicting
    File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 1141, in best_match
    return self.obtain(req, installer)
    File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 1153, in obtain
    return installer(requirement)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 672, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 698, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 879, in install_eggs
    return self.build_and_install(setup_script, setup_base)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 1118, in build_and_install
    self.run_setup(setup_script, setup_base, args)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\easy_install.py", line 1104, in run_setup
    run_setup(setup_script, args)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\sandbox.py", line 257, in run_setup
    raise
    File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\sandbox.py", line 199, in setup_context
    yield
    File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\sandbox.py", line 170, in save_modules
    saved_exc.resume()
    File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\sandbox.py", line 144, in resume
    type, exc = map(pickle.loads, self._saved)
    ModuleNotFoundError: No module named 'commands'

    C:\ProgramData\Anaconda3\Scripts\InstaPy>

最佳答案

我遇到了同样的问题,但通过运行解决了它: 点安装。在 InstaPy 文件夹(根)

关于python-3.x - 使用python setup.py install时InstaPy安装报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52764464/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com