我使用的是Anaconda 1.7.5 64bit的Windows 8.
我创建了一个新的Anaconda环境
conda create -p ./test python=2.7 pip
来自C:\Pr\TEMP\venv\
.
这很好用(有一个带有新python发行版的文件夹).康达告诉我打字
activate C:\PR\TEMP\venv\test
激活环境,但这会返回:
No environment named "C:\PR\temp\venv\test" exists in C:\PR\Anaconda\envs
我该如何激活环境?我究竟做错了什么?
我在我的Linux(Ubuntu 14.04)机器上运行了Pycharm 4.除了系统python之外,我还安装了Anaconda.让两者很好地融合在一起似乎有点问题...... PyCharm为virtualenv
s 提供了一些有趣的集成pip
,但Anaconda Python发行版似乎更喜欢使用自己的conda
工具进行这两项活动.
是否有一种相对简单/无痛的方式可以conda
与PyCharm一起使用?不仅仅是作为替代解释器,即在项目解释器的Anaconda Python二进制文件中指向PyCharm,但是能够创建,源/激活和停用虚拟环境,在这些虚拟环境中添加/删除包等.
或者我将不得不在使用Anaconda之间做出选择(并且拥有比系统更新的和最新的python),并且能够最大程度地使用PyCharm的功能?
我正在使用Python3.6,当我尝试使用pip3安装"模块"时,我面临下面提到的问题"pip配置了需要TLS/SSL的位置,但是Python中的ssl模块不可用"
请帮我解决这个问题
我试图从Windows命令提示符(Windows 10)运行python.因此,当未配置路径环境变量时,结果是典型的结果
c:\windows\system32>python
'python' is not recognized as an internal or external command, operable
program or batch file
Run Code Online (Sandbox Code Playgroud)
但是,我不确定哪个是我应该在路径变量中设置的正确目录.
我尝试了一些变化,但没有一个变化,包括:
c:\users\xxx\anaconda3
c:\users\xxx\anaconda3\Scripts
c:\users\xxx\anaconda3\libs\python34
Run Code Online (Sandbox Code Playgroud)
并且它们都不起作用.
有没有人有这个特殊系统星座(windows,anaconda)的经验.谢谢.
在运行中途Conda Update --all
,更新停滞不前.多个包已更新.现在,当我跑步conda update --all
或者conda update conda
,我得到这个回应:
(C:\Users\*****\AppData\Local\Continuum\Anaconda3) C:\Users\*****>conda update conda
Fetching package metadata ...
CondaHTTPError: HTTP None None for url <None>
Elapsed: None
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),),)
Run Code Online (Sandbox Code Playgroud)
我重复conda update conda
了好几天,结果没有变化.我可以看到没有HTTP,但是conda info --a
显示了频道网址.
(C:\Users\*****\AppData\Local\Continuum\Anaconda3) C:\Users\*****>conda info -a
Current conda install:
platform …
Run Code Online (Sandbox Code Playgroud) 我在python3.4上有一个脚本,直到我下载文件的网站决定使用https并且现在我收到错误但我无法弄清楚如何可以检索文件.
我的脚本导入以下库并使用urlretrive获取以前的文件.因为它现在转发到具有302重定向的https.我收到一些错误.
import urllib
import urllib.request
urllib.request.urlretrieve("http://wordpress.org/latest.tar.gz", "/thefile.gz")
Run Code Online (Sandbox Code Playgroud)
我的错误: -
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/urllib/request.py", line 178, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/local/lib/python3.4/urllib/request.py", line 153, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.4/urllib/request.py", line 461, in open
response = meth(req, response)
File "/usr/local/lib/python3.4/urllib/request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.4/urllib/request.py", line 493, in error
result = self._call_chain(*args)
File "/usr/local/lib/python3.4/urllib/request.py", line 433, in _call_chain
result …
Run Code Online (Sandbox Code Playgroud) 我在C:\ Users\me\Miniconda3安装了Miniconda3,PyCharm中的'Project Interpreter'设置为我的conda环境,这一切都正常.然而,似乎没有为我的路径变量设置conda,就好像我输入conda
我得到的PyCharm终端一样
'conda' is not recognized as an internal or external command, operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
有没有办法将PyCharm终端设置为像Anaconda Prompt一样?
我安装了Windows 10,PyCharm 2018.1 EAP和conda 4.4.10.
我的资源:
Python 2.7、Ubunutu 18.04、Pycharm、虚拟框oracle
我有一个用 python 构建的自动化解决方案。该解决方案可以从两个运行cmd
或pycharm
当然。2 个运行自动化解决方案的选项。
python main.py args a,b,c...(run 1 suite of tests)
python jenkinsRun.py arg a,b,c...(run main.py with diff args each time -lets say 5 time for instance)
Run Code Online (Sandbox Code Playgroud)
一旦jenkinsRun.py
运行,它将main.py
像这样执行每个:
os.system('python main.py %s %s %s %s %s %s'%(STD,config.VpcStackName, '-dryrun', 'false', '-tenant' ,config.PROD_STAGE_Tenant))
Run Code Online (Sandbox Code Playgroud)
请注意,这是我 3 年前实现它的方式......可能是更好的方法,比如 using __import__
,但需要传递参数的方法等......
无论如何,运行时:
python main.py arg a,b,c..
Run Code Online (Sandbox Code Playgroud)
都好。
运行时:
jenkinsRun.py
Run Code Online (Sandbox Code Playgroud)
每次都应该使用 diff args 运行 main 我得到异常:
os.system('python main.py %s %s %s %s %s …
Run Code Online (Sandbox Code Playgroud) 我在 Win10 上遇到 _ssl 问题。我已将 python 包和代码从 Windows 7 移至 Windows 10。一开始我面临以下问题:
导入错误:缺少必需的依赖项 ['numpy']
但是这个问题通过重新安装 numpy 和 pandas 的 .whl 包得到了解决。
目前我在执行代码时面临以下问题:
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified procedure could not be found.
Run Code Online (Sandbox Code Playgroud)
参考关于堆栈溢出的其他问题并尝试了几个步骤:
按照此Python 3.7 anaconda 环境中的建议更改路径变量- 导入 _ssl DLL 加载失败错误
安装 pyopenssl 。
更新了系统环境变量。
重新启动了pycharm。
目前在 Anaconda 提示符下显示为:
(base) C:\>
(base) C:\>python
Python 3.7.0 (default, Aug 14 2018, 19:12:50) [MSC v.1900 32 bit …
Run Code Online (Sandbox Code Playgroud) 在我的 python 脚本中,我使用 requests 模块调用 API 来 GET 和 POST 数据。
Python环境:anaconda3,python 3.7 /软件包:requests 2.24.0,pyinstaller 3.6,openssl 1.1.1h...
我对 PyInstaller 生成的 EXE 文件存在以下问题:当我运行此文件时,收到以下错误消息。当我从 Python 运行脚本时,不会发生此错误:
Traceback (most recent call last):
File "site-packages\PyInstaller\loader\rthooks\pyi_rth_certifi.py", line 13, in <module>
File "c:\programdata\anaconda3\envs\...\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
File "ssl.py", line 98, in <module>
ImportError: DLL load failed: The specified module could not be found.
[20188] Failed to execute script pyi_rth_certifi
Run Code Online (Sandbox Code Playgroud)
如果我遵循例外错误行(ssl.py):
import _ssl # if we can't import it, let the error propagate
Run Code Online (Sandbox Code Playgroud)
为什么无法导入ssl?
我在一些帖子中搜索了很长时间,但所有这些答案都没有帮助,例如:
由于无法导入,我无法调试代码或运行Python控制台ssl
。使用我创建的两个Anaconda虚拟环境时,出现这种现象。
例如,当我尝试调试使用的Python代码时,会boto3
看到以下错误:
C:\home\miniconda\envs\scw\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 57111 --file C:/home/git/onvif_interact/onvif_interact/notifications.py --config C:\home\data\pullpoint\camera_desk.ini
pydev debugger: process 22816 is connecting
Connected to pydev debugger (build 183.5429.31)
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py", line 1741, in <module>
main()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py", line 1735, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py", line 1135, in run
pydev_imports.execfile(file, globals, locals) # …
Run Code Online (Sandbox Code Playgroud) 我尝试在我的电脑上安装 SSL,但不断收到以下错误。我在这里错过了一些非常基本的东西吗?我尝试升级我的 pip 并升级 setuptools,但似乎没有任何效果。任何帮助将不胜感激。
C:\Users\Michael\PycharmProjects\py4e>pip3 install ssl
Collecting ssl
Using cached https://files.pythonhosted.org/packages/83/21/f469c9923235f8c36d5
fd5334ed11e2681abad7e0032c5aba964dcaf9bbb/ssl-1.16.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\MICHAE~1\AppData\Local\Temp\pip-install-qtieo4so\ssl\setup.
py", line 33
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('loo
king for', f)?
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\M
ICHAE~1\AppData\Local\Temp\pip-install-qtieo4so\ssl\
Run Code Online (Sandbox Code Playgroud) 我刚刚在 Windows 10 上安装了最新的 Anaconda,想用 anaconda 提示符启动 jupyter notebook,但出现以下错误。虽然我认为这是一个常见问题,但我找不到解决方案。
(base) C:\Users\Felix>jupyter notebook
Traceback (most recent call last):
File "C:\Users\MyUser\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\MyUser\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 62, in <module>
from tornado import httpserver
File "C:\Users\MyUser\Anaconda3\lib\site-packages\tornado\httpserver.py", line 29, in <module>
import ssl
File "C:\Users\MyUser\Anaconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.
Run Code Online (Sandbox Code Playgroud)
另外:我不能pip
用来安装东西。出现以下消息
WARNING: pip is configured …
Run Code Online (Sandbox Code Playgroud) python ×11
anaconda ×7
conda ×4
pycharm ×3
ssl ×3
pip ×2
virtualenv ×2
dll ×1
installation ×1
jupyter ×1
miniconda ×1
openssl ×1
pexpect ×1
pyinstaller ×1
python-2.7 ×1
python-3.4 ×1
python-3.x ×1
windows ×1