我在Anacondas Python 3.3中安装Tweepy时遇到问题。
首先,我进入了Python 3.3安装的scripts目录。然后我跑了
easy_install tweepy
如果我在默认的Python Scripts目录中运行它,则它可以工作,但是那是我不想使用的旧Python版本。
我的输出如下。它说了有关导入报价的内容。
C:\Anaconda\envs\py33\Scripts>easy_install tweepy Searching for tweepy Reading http://pypi.python.org/simple/tweepy/ Best match: tweepy 2.3.0 Downloading https://pypi.python.org/packages/source/t/tweepy/tweepy-2.3.0.tar.gz#md5=065c80d244360988c61d64b5dfb7e229 Processing tweepy-2.3.0.tar.gz Writing c:\users\jon\appdata\local\temp\easy_install-tmda2q\tweepy-2.3.0\setup.cfg Running tweepy-2.3.0\setup.py -q bdist_egg --dist-dir c:\users\jon\appdata\local\temp\easy_install-tmda2q\tweepy-2.3.0\egg-dist-tmp-006ghp Traceback (most recent call last): File "C:\Anaconda\envs\py33\Scripts\easy_install-script.py", line 5, insys.exit(main()) File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 1986, in main with_ei_usage(lambda: File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 1967, in with_ei_usage return f() File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 1990, in distclass=DistributionWithoutHelpCommands, **kw File "C:\Anaconda\envs\py33\lib\distutils\core.py", line 148, in setup dist.run_commands() File "C:\Anaconda\envs\py33\lib\distutils\dist.py", line 930, in run_commands self.run_command(cmd) File "C:\Anaconda\envs\py33\lib\distutils\dist.py", line 949, in run_command cmd_obj.run() File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 360, in run self.easy_install(spec, not self.no_deps) File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 604, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 634, in install_item dists = self.install_eggs(spec, download, tmpdir) File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 829, in install_eggs return self.build_and_install(setup_script, setup_base) File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 1109, in build_and_install self.run_setup(setup_script, setup_base, args) File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\command\easy_install.py", line 1095, in run_setup run_setup(setup_script, args) File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\sandbox.py", line 34, in run_setup lambda: exec(compile(open( File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\sandbox.py", line 82, in run return func() File "C:\Anaconda\envs\py33\lib\site-packages\setuptools\sandbox.py", line 37, in {'__file__':setup_script, '__name__':'__main__'}) File "setup.py", line 4, in File "c:\users\jon\appdata\local\temp\easy_install-tmda2q\tweepy-2.3.0\tweepy\__init__.py", line 12, in File "c:\users\jon\appdata\local\temp\easy_install-tmda2q\tweepy-2.3.0\tweepy\models.py", line 6, in File "c:\users\jon\appdata\local\temp\easy_install-tmda2q\tweepy-2.3.0\tweepy\utils.py", line 9, in ImportError: cannot import name quote
STEEL.. 6
由于您将Anaconda用于python。 https://anaconda.org/conda-forge/tweepy
像这样从终端安装tweepy:
conda install -c conda-forge tweepy
-c
表示频道= conda-forge