Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vaspy不能适配python2.7及其canopy环境 #6

Open
YYangZiXin opened this issue Dec 17, 2017 · 5 comments
Open

vaspy不能适配python2.7及其canopy环境 #6

YYangZiXin opened this issue Dec 17, 2017 · 5 comments

Comments

@YYangZiXin
Copy link

python2.7中类的继承语法有所改变,可能因此导致了大量类似‘ValueError: XDATCAR not exist. ’的错误。
现在canopy环境已更新为内置python2.7,希望可以更新您的vaspy,非常感谢。

@PytLab
Copy link
Owner

PytLab commented Dec 17, 2017

你好,vaspy是兼容py3和py2的,而且canopy也都做过测试。从你错误的信息来看,可能是你安装vaspy有误。如果方便的话可以将你的脚本和具体报错信息贴出来。

@YYangZiXin
Copy link
Author

YYangZiXin commented Dec 17, 2017

谢谢回复,之前的错误信息找不到了,现在错误变为了

`%run "D:\VASPy-master\scripts\md_viz\map.py"

ImportErrorTraceback (most recent call last)
D:\VASPy-master\scripts\md_viz\map.py in <module>()
      8 import matplotlib.patheffects as pe
      9 
---> 10 from vaspy.iter import XdatCar, AniFile
     11 from traj import get_trajectories
     12 
C:\Users\y7216\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\vaspy\iter.py in <module>()
     21     plt_installed = False
     22 
---> 23 from vaspy import VasPy, PY2
     24 from vaspy import LazyProperty
     25 from vaspy.atomco import PosCar, XyzFile
ImportError: cannot import name VasPy `

我想应该是因为vasyp安装错误,我安装的方法是在canopy的命令行中

`(User) D:\VASPy-master>pip install vaspy
Requirement already satisfied: vaspy in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages
Requirement already satisfied: scipy>=0.18.0 in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from vaspy)
Requirement already satisfied: matplotlib>=1.5.2 in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from vaspy)
Requirement already satisfied: numpy>=1.11.1 in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from vaspy)
Requirement already satisfied: six>=1.10 in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from matplotlib>=1.5.2->vaspy)
Requirement already satisfied: python-dateutil in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from matplotlib>=1.5.2->vaspy)
Requirement already satisfied: functools32 in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from matplotlib>=1.5.2->vaspy)
Requirement already satisfied: pytz in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from matplotlib>=1.5.2->vaspy)
Requirement already satisfied: cycler>=0.10 in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from matplotlib>=1.5.2->vaspy)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from matplotlib>=1.5.2->vaspy)`

之前按照您网页中的方法在(管理员)CMD中尝试安装时出错:

`C:\WINDOWS\system32>alias canopy='\Users\y7216\AppData\Local\Enthought\Canopy\edm\envs\User\python'
'alias' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

在powerShell中尝试安装时出错:

PS C:\Users\y7216> alias canopy='\Users\y7216\AppData\Local\Enthought\Canopy\edm\envs\User\python'
alias : 此命令找不到匹配的别名,因为具有 name“canopy=\Users\y7216\AppData\Local\Enthought\Canopy\edm\envs\User\python
”的别名不存在。
所在位置 行:1 字符: 1
+ alias canopy='\Users\y7216\AppData\Local\Enthought\Canopy\edm\envs\Us ...
+ 
    + CategoryInfo          : ObjectNotFound: (canopy=\Users\y...nvs\User\python:String) [Get-Alias], ItemNotFoundExce
   ption
    + FullyQualifiedErrorId : ItemNotFoundException,Microsoft.PowerShell.Commands.GetAliasCommand

@YYangZiXin
Copy link
Author

有时间解答一下吗?

@PytLab
Copy link
Owner

PytLab commented Dec 20, 2017

你好,根据你的跑错信息是vaspy未安装成功,我readme里面的alias是针对*nix平台的。不过在windows平台上直接使用canopy命令行中的pip是可以的,你可以查看下你本地c:\users\y7216\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages中是否有vaspy

另外,你执行的时候也是在canopy中执行的吗?

@YYangZiXin
Copy link
Author

该路径有vaspy。执行是在cannopy的Editor中打开并运行的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants