简体   繁体   English

在Anaconda3中安装模块

[英]Installing Modules in Anaconda3

Halloo 哈鲁

Alright, I've been wracking my brains and trying over and over again, but I cannot install any modules for my Anaconda Python 3.5. 好吧,我一直在绞尽脑汁,一遍又一遍地尝试,但是我无法为Anaconda Python 3.5安装任何模块。 I have tried everything under the sun. 我已经在阳光下尝试了一切。 After looking around people either recomend using pip install while in the Anaconda\\Scripts directory, while other just say to use the "conda" command. 环顾四周后,要么建议在Anaconda \\ Scripts目录中使用pip install进行安装,而其他人则只是说要使用“ conda”命令。 Neither work. 都不起作用。 When using the conda, sometimes, this would happen 使用conda时,有时会发生这种情况

$Anaconda3> conda install -c anaconda quandl=2.8.9
$Fetching package metadata: ........Error: Could not find URL: http://www.pygame.org/pcr/win-64/

This is especially notable to me because before I spent hours upon hours trying instal pygame before to no avail, but this was months ago. 这对我来说尤其值得注意,因为在我花了几个小时尝试安装pygame之前没有任何效果,但这是几个月前。

In other cases, this would happen: 在其他情况下,会发生这种情况:

$Fetching package metadata: .........An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at:

https://github.com/conda/conda/issues

Include the output of the command 'conda info' in your report.


Traceback (most recent call last):
 File "C:\Program Files\Anaconda\Scripts\conda-script.py", line 4, in <module>
sys.exit(main())
File "C:\Program Files\Anaconda\lib\site-packages\conda\cli\main.py", line 194, in main
args_func(args, p)
File "C:\Program Files\Anaconda\lib\site-packages\conda\cli\main.py", line 201, in args_func
args.func(args, p)
File "C:\Program Files\Anaconda\lib\site-      packages\conda\cli\main_install.py", line 45, in execute
install.install(args, parser, 'install')
 File "C:\Program Files\Anaconda\lib\site-packages\conda\cli\install.py", line 244, in install
offline=args.offline)
 File "C:\Program Files\Anaconda\lib\site-packages\conda\cli\common.py",    line 548, in get_index_trap
return get_index(*args, **kwargs)
 File "C:\Program Files\Anaconda\lib\site-packages\conda\api.py", line 42, in get_index
unknown=unknown)
File "C:\Program Files\Anaconda\lib\site-packages\conda\utils.py", line 119, in __call__
value = self.func(*args, **kw)
File "C:\Program Files\Anaconda\lib\site-packages\conda\fetch.py", line 255, in fetch_index
repodatas.append((url, future.result()))
 File "C:\Program Files\Anaconda\lib\site-packages\concurrent\futures\_base.py", line 407, in result
return self.__get_result()
File "C:\Program Files\Anaconda\lib\site-    packages\concurrent\futures\_base.py", line 359, in __get_result
reraise(self._exception, self._traceback)
File "C:\Program Files\Anaconda\lib\site-  packages\concurrent\futures\_compat.py", line 107, in reraise
exec('raise exc_type, exc_value, traceback', {}, locals_)
File "C:\Program Files\Anaconda\lib\site-packages\concurrent\futures\thread.py", line 61, in run

etc..., it goes on for quite a bit. 等...,它持续了很多时间。

Furthermore, if I tried to use a pip install inside the \\Anaconda3\\Scripts and it actually went, for some reason, and installed it in my Anaconda folder for Python 2.7, but not in Python3 (I just found this out while typing this). 此外,如果我尝试在\\ Anaconda3 \\ Scripts内使用pip安装,但由于某种原因它确实进行了安装,并将其安装在Python 2.7的Anaconda文件夹中,但未安装在Python3中(我只是在键入时发现了这一点) 。 So, I'm still stuck that I don't have my quandl module for Python 3. Can anyone please help me fix this issue? 因此,我仍然感到困惑,因为我没有适用于Python 3的quandl模块。有人可以帮我解决此问题吗? Everytime I try to back to learn some programming, it's the packages and modules to keep killing me and wasting hours upon hours of my time. 每当我尝试回去学习一些编程时,它都是用来杀死我并浪费时间的软件包和模块。 If I can just get over this issue, it would make all the difference. 如果我能克服这个问题,那么一切都会有所不同。 Thanks! 谢谢!

Try this: 尝试这个:

conda create -n quandl-env python=3.5
activate quandl-env
conda install --override-channels --channel anaconda quandl=2.8.9

It looks like you have a bad channel ( http://www.pygame.org/pcr/win-64/ ) in your conda config. 您的conda配置中似乎有一个错误的频道( http://www.pygame.org/pcr/win-64/ )。 What does conda config --get return? conda config --get返回什么? I suspect that you will see that pygame channel there which doesn't appear to work. 我怀疑您会在那里看到该pygame频道似乎无效。 You can remove it from your .condarc file or via conda config --remove . 您可以将其从.condarc文件中删除,也可以通过conda config --remove删除。

You probably only want to have the default channels. 您可能只想拥有默认频道。 You can try editing your .condarc file which should be in your home directory ( C:\\Users\\.. ). 您可以尝试编辑.condarc文件,该文件应位于主目录( C:\\Users\\.. )中。 Edit it so that it looks like this: 编辑它,使其看起来像这样:

channels:
- defaults

Updated: Fixed the conda config usage, more explanation on the .condarc, and added an environment creation to make sure this package is being installed in a 3.5 environment. 更新:修复了conda config用法,有关.condarc的更多说明,并添加了环境创建功能以确保在3.5环境中安装了此软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM