问题描述
我目前在Pycharm v4中开发并使用Anaconda 64bit.现在,我需要开始使用仅支持Anaconda 32位的 http://www.zipline.io/.有没有办法同时安装32位和64位版本,只是告诉Pycharm用于特定项目的是哪个版本?
I currently develop in Pycharm v4 and use Anaconda 64bit. I now need to begin using http://www.zipline.io/ which only supports Anaconda 32bit. Is there a way to have both the 32 and 64 bit versions installed and just tell Pycharm which one to use for a specific project?
Pycharm支持从IDE内创建virtualenv环境,也许可以通过这种方式完成某些工作?我以前从未使用过虚拟环境.还是可以只将Anaconda 32bit安装到它自己的文件夹中,然后告诉Pycharm每个项目要使用哪个.
Pycharm supports the creation of virtualenv environments from within the IDE, perhaps something can be done in that way? I've never used virtual environments before. Or would it be possible to just install Anaconda 32bit into it's own folder, then tell Pycharm which to use for each project.
任何建议都值得赞赏.
我已经将Anaconda 32位安装在一个单独的文件夹中,并从Pycharm设置中为该解释程序选择了此版本.尝试运行基本的zipline项目时,出现以下错误:
I have installed Anaconda 32 bit in a separate folder and selected this version from within Pycharm settings for the interpreter. When trying to run a basic zipline project I get the following error:
"C:\...\Anaconda3 - 32bit\python.exe" "E:/Python Projects/ZiplineTesting/Main.py"
Traceback (most recent call last):
DLL load failed: %1 is not a valid Win32 application.
File "E:/Python Projects/ZiplineTesting/Main.py", line 1, in <module>
from zipline.api import order, record, symbol
File "C:\...\AppData\Roaming\Python\Python34\site-packages\zipline\__init__.py", line 25, in <module>
from . import data
File "C:\...\AppData\Roaming\Python\Python34\site-packages\zipline\data\__init__.py", line 1, in <module>
from . import loader
File "C:\...\AppData\Roaming\Python\Python34\site-packages\zipline\data\loader.py", line 25, in <module>
import pandas as pd
File "C:\...\AppData\Roaming\Python\Python34\site-packages\pandas\__init__.py", line 7, in <module>
from . import hashtable, tslib, lib
ImportError: DLL load failed: %1 is not a valid Win32 application.
Process finished with exit code 1
值得注意的是,在我的代码中,Pycharm突出显示了我的import语句存在错误(带有"order"和"record").但是,导入没有任何问题:
It's worth noting that in my code, Pycharm has highlighted my import statement as having an error (with 'order' as well as 'record'). However there is nothing wrong with the import:
from zipline.api import order, record, symbol
错误是:
Unresolved reference 'order'
This inspection detects names that should resolve but dont.
Due to dynamic dispatch and duck typing, this is possible in a limited
but useful number of cases, Top-level and class-level items are supported
better than instance items.
关于我可能做错了什么的任何想法?我尝试卸载并重新安装zipline并没有帮助.似乎与我以前的64位产品和新的32位产品存在某种冲突.
Any ideas on what I might be doing incorrectly? I have tried uninstalling and reinstalling zipline which hasn't helped. It seems like there is some sort of conflict with my prior 64bit stuff with the new 32bit stuff.
推荐答案
在PyCharm的设置"菜单中,找到项目:[项目名称]"部分.您可以从此处选择用于项目的Python解释器.
In the "Settings" menu of PyCharm look for the "Project: [project name]" section. You can select the Python interpreter used for the project from there.
只要将32位版本的Anaconda与64位版本安装在不同的位置,就不会有问题.
As long as the 32-bit version of Anaconda is installed to a separate location from the 64-bit version, there should be no problem.
这篇关于我需要Anaconda 32位和64位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!