-
Notifications
You must be signed in to change notification settings - Fork 93
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
提示base.py文件不存在的问题 #2
Comments
我对ubuntu不是很熟悉,我们版本一致,在本地测试没有发现问题就直接push了。感谢提供新情况。 |
谢谢作者的回复,我回复的解决方法只能解决我那台机器的问题,今天特意对照你的main.py代码看了一下我的系统,反馈如下: 我个人估计之前出问题的原因可能是在这段代码内,如若不正确,忘作者指正: |
@hchufeng 看来确实是环境问题。你的Python环境跟我接触到的不一样,而且我是第一次接触 - -! 可以考虑按照你的路径信息升级一下。 |
@hchufeng |
@kingmo888 |
mac 怎么使用,也存在这个文件找不到的问题。 |
解决了,找到anacoda 安装路径 bin下的python版本直接执行main.py就可以了,谢谢了。 |
测试在WIN7方法下:电脑有Anaconda自带python3.6,本机其他地方有3.5版本python,用python main.py 运行失败 |
for ---------FEDORA------------- //main.py -- coding: utf-8 --""" @author: lizenghai import os,shutil,sys thissys = platform.system() def checkpath(path): search site-packages foldersitepath="." creat zh_CN language folderzh_CN = sitepath + '{0}spyder{1}locale{2}zh_CN{3}LC_MESSAGES'.format(flag,flag,flag,flag) base.py add zh_CNconfigpath = sitepath + '{0}spyder{1}config{2}base.py'.format(flag,flag,flag) print(configpath) newpath = sitepath + '{0}base.py'.format(flag)
else: newf.close() rename old base.pyif os.path.exists(sitepath + r'{0}spyder{1}config{2}base_bak.py'.format(flag, flag, flag)): remove new base.pyshutil.move(newpath,configpath) try: |
系统为ubuntu16.04,运行pip安装的spyder3.1.3版本,pip源为国内的阿里镜像
在/home/user/.local/lib/python2.7/site-packages/spyder 中,没有发现config,运行python main.py时会报找不到base.py文件和权限不足的问题
解决过程如下:
在/home/user/.local/lib/python2.7/site-packages/spyder下新建 config目录,将/usr/local/lib/python2.7/dist-packages/spyder/config目录下的base.py复制了一份到/home/user/.local/lib/python2.7/site-packages/spyder/config中,再次运行sudo python main.py,运行后的终端显示正常,实际进入spyder中还是无法修改中文。
最终解决方法,将/home/user/.local/lib/python2.7/site-packages/spyder/config中生成的base.py文件复制到/usr/local/lib/python2.7/dist-packages/spyder/config,替代原来的文件,同时将/home/user/.local/lib/python2.7/site-packages/spyder/locale中的zh_CN同样复制过去。
重新启动spyder后,可以正常修改中文。
The text was updated successfully, but these errors were encountered: