pycharm package管理安装requests 的 package的时候总跳出来ERROR,看不懂啊看不懂啊神马情况

5856人阅读
Python(5)
  PyCharm安装第三方库是十分方便的,无需pip或其他工具,平台就自带了这个功能而且操作十分简便。如下:
【注】:本人PyCharm已汉化,若是英文版按括号中英文指示操作即可。
  1. 打开软件,点击左上角“文件(File)”—&“设置(setting)”;
  2. 选择弹出界面左上角的“项目(Project): PyCharm_Demo”—&“project Interpreter”;
  3. 点击右上方“+”进入搜索第三方库的界面;
  4. 在搜索框中搜索对应想安装的库或者模块,点击左下方“Install package”就行了。如果安装完成,该库显示字体颜色会变成蓝色,并且在上一个界面罗列出你已安装的库;
  需要注意一下,如果你安装的project interpreter也就是python版本为3.x版本,很多2.x版本的库是搜索不到的,例如:urllib2。库的更改请自行查阅相关资料。
个人学习记录,由于能力和时间有限,如果有错误望读者纠正,谢谢!
转载请注明出处:CSDN 无鞋童鞋
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:234512次
积分:2925
积分:2925
排名:第12229名
原创:161篇
转载:12篇
评论:134条
我的GitHub:
如有疑问,欢迎留言交流!
The best preparation for tomorrow is doing your best today!
无鞋童鞋——在海边赤脚奔跑,我愿做一名逐日梦想家!
文章:14篇
阅读:3204
阅读:2195
文章:11篇
阅读:4076
(17)(34)(4)(11)(17)(15)(5)(2)(18)(23)(26)工作环境完全切换到 Ubuntu,有点不太适应,如何解决? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
已注册用户请 &
Distributions
中文资源站
工作环境完全切换到 Ubuntu,有点不太适应,如何解决?
· 341 天前 · 4614 次点击
在虚拟机呆了将近一年,发现自己还是太 naive ,很多软件和服 Linux 都不能提供。
virtualBox 、 QQ 、 L2TP 。。。。。解决文档很多但看不懂,还需要修炼啊。
第 1 条附言 &·& 340 天前
谢谢大家,上面的问题已经解决了。
virtualbox:我把安全模式启动给关闭了。
QQ:在虚拟机下面解决了。
L2TP:使用@keysona 的方法也解决了。
把工作环境换成Linux只是想使自己更快的熟悉而已:)
84 回复 &| &直到
06:31:09 +08:00
& &341 天前
换回原来用的平台并在虚拟机里使用 Linux 。
& &341 天前
& &341 天前
换回去。。
多花点时间在别的方面
& &341 天前
那用 win10 ...然后用子系统的 ubuntu 过度试试咯~
& &341 天前 via Android
楼主工作做什么的,多少要提一下吧……
& &341 天前
windows 是最合适我的桌面环境了,毕竟从 3.1 用到现在那么多年了。
win10 实在解决不了的时候才去用 linux ( WIFI 抓包)。
基本上都是 windows 开 xshell 远程配置服务器。例如 python3.5 下的 mysql 连接模块,在 win 下 pip 安装死活编译不了,装了所有编译环境都不行,吐血了。最后硬是谷歌到了一个编译好的 whl 文件给装了上去,继续开 pycharm 撸。
& &341 天前 via Android
@ 大三学生一枚,完全切换到 Linux 是想从事 Linux 服务端的开发。
& &341 天前
@ 没必要, shell 过去就好。。
& &341 天前 via Android
@ bash on Windows 还不太成熟,哈哈,也用了一段时间,感觉不太合适,想等到比较成熟再去用
& &341 天前
Linux 也可以安装虚拟机安装个 XP 用 QQ ,看你更多的时间是用在 Linux 系统下还是 Windows 下
至于 L2TP 确实比较...
用 PPTP 方便些,或者换 55
& &341 天前
换 Windows ,不要把时间浪费在 Linux 桌面上
& &341 天前
我转用 ubuntu 工作好几年了,没事,多用用就习惯了,坑还好不算太多
& &341 天前
只有我想说用 win 虚拟机吗
& &341 天前
要不用 mac 试试?
& &341 天前
我跟你讲,装个 linux server ,然后 putty 上去慢慢玩就行了
& &341 天前
在用 Manjaro KDE,
QQ 有 wine 国际版(虽然还是用手机 qq 多), L2TP 有自带。
有问题多看 Arch 的 wiki , 日常使用基本没有问题。
& &341 天前
双系统还不能解决那就 Win 下面虚拟机吧
& &341 天前
1 个月怎么也适应了。。。。。。否则。。你不适合用 Linux
& &341 天前
连接 L2TP 用网络管理器就能搞定吧(貌似需要一个插件?)。。
QQ 建议不要折腾了,非要用的话在 virtualBox 里装个 windows 的虚拟机。。
关于“很多软件和服 Linux 都不能提供”
建议你可以把需要的软件发出来,大家可以告诉你一些代替品
& &341 天前 via iPad
如果你的工作适合用 Linux ,你根本不会来发这个帖子。。
& &341 天前
非国产软件问题,去
搜搜基本都有解决答案
& &341 天前
如果你说把日常电脑环境换到 ubuntu 不太适应我还好理解。但你说工作环境变成 ubuntu 觉得软件不够,那我到想知道你平时工作是在做什么的。我设想你的工作是程序员,但是考虑到这个网站上嘻皮士的数量大于程序员,所以可能我的设想是错误的
& &341 天前
你工作环境为啥要装 QQ ?
& &340 天前
ubuntu16.04 L2TP 可以参考这篇文章。
实测成功。
由于我学校是锐捷, L2TP 共用的。默认都是直接上锐捷。
如果你觉得不方便,还是尽早换回 ubuntu 。
window 下模拟 linux shell 的用 babun 就行了。
通常都是 babun 下开 ssh 连自己 vps 。
以前的解决方案,开 vmware ,开 win7 精简版装迅雷或者 qq 之类的。
下载的话可以 aria2 代替了。
& &340 天前
如果你觉得不方便,还是尽早换回 window 。
window 不用折腾太多...
用了一年 linux 换回 window 了。
不过, vim , shell 之类的就戒不掉了。
& &340 天前 via Android
@ 一样,也是想从事服务器方面的开发
& &340 天前
装个虚拟机
里面装 win7
& &340 天前
继续修炼吧,有条件选择趁手的工具就别在工具的选择上耗费太多的时间和精力,如果没有太多可选择的,那么就当这是趁手的工具,好好修炼即可,手熟了自然就好了。
& &340 天前 via Android
既然是学生,那就直接腾讯云买个学生机,装 Linux ,然后在 windows 下用 xshell 远程过去折腾就行了
& &340 天前
现在只有打游戏的台式装的 Win7,平时都是 MacOS 和 Arch
& &340 天前
那就赶紧适应阿~~
竟然没有人这么说
& &340 天前 via Android
VirtualBox 神马情况?
& &340 天前
linux 下 vm 感觉比 vbox 好用多了,不会有根据不同的发行版有不同的版本了
大型软件的解决文档感觉不如博客内容实在
曾经也想只用 windows ,但是 windows defender 动不动就在后台扫描这个那个,笔记本的风扇就没停过,相反 ubuntu 的风扇就没转过
& &340 天前 via Android
QQ 可以用清风 QQ ,基本满足使用。。。
& &340 天前
virtualBox 有 ubuntu 版本的
@ 求分享下载链接
我下载开虚拟机跑 qq
& &340 天前 via iPhone
我用虚拟机和 bitvise 开 tmux 用 Vim 写了一年多,反正你一定要在 Linux 下干的活,大多数用 CLI 就能搞定了(开发 gui 程序的话忽略我)
& &340 天前 via Android
适应不了就换回去,没必要勉强自己,装个双系统也是不错的选择。
& &340 天前
如果不是 LINUX 控的话,就换回去吧,在国内好多事还是 LINUX 做不了的,玩玩行。
& &340 天前
建议 windows/osx+vagrant
不过我还是装了 fedora/osx 双系统,折腾.
& &340 天前
工作环境一直用 Ubuntu ,让我切回 windows7 我也不适应
& &340 天前
@ 国内哪些事 Linux 做不了?
& &340 天前
作为一个 phper ,早已在 linux 下开发两年了。。。。。。刚开始转过来确实很累。。。。现在已经很顺手了。。。。 64G 固态硬盘装 Linux
然后挂载一个 1T 硬盘
分 500G 建立一个 win7 虚拟机。。。然后剩下 500G 装个 win7 双系统。。。。平时工具就开 linux 和 win7 虚拟机。。。放假就开双系统的 win7 打游戏。。。。。。。
& &340 天前
Window 10 + VirtualBox ,用着挺好的呀。
& &340 天前
我现在感觉我不喜欢 windows. 5 年开发,4 年在 ubuntu1 年在 mac.现在的感觉是用鼠标会手累(用红鼻子和小托盘),用 windows 不习惯,而且好慢.前些日子我又装了一块 320 的 ssd,跑的飞起
& &340 天前
@ 想从事 linux 服务端开发一定要用 linux 桌面环境?我觉得 win10 和 mac os 用着都比 ubuntu 舒服。
& &340 天前
网上的一个 ubuntu 1604 的 QQ 解决方案,还不错。
& &340 天前 via Android
我个人笔记本用 debian 已经一年了,最近又在尝试 arch 。用 linux 的好处就是没有各种全家桶,世俗的软件都不兼容,可以安心码代码。
& &340 天前 via Android
你需要 Ubuntu on Windows 10
& &340 天前 via Android
wine 的 QQ ,装好 wine 环境直接解压就能用的
& &340 天前 via Android
@ 楼上链接咋连起来了。。。
& &340 天前
如果不喜欢各种 Linux 发行版桌面,就在 Windows 或者 macOS 下用 vagrant 好了,
& &340 天前
@ 生产环境 Linux 没得说,但是生活中还有其他常用的软件哈
& &340 天前
我现在工作用的就是 ubuntu ,除了 qq 经常掉线(wine qq) 和输入不了中文以外
其余的都相当好用
ubuntu 在电脑 128 的固态,
还有个 win10
周末打游戏,放机械
记得大三那年,装了个 ubuntu ,第一眼看,很牛逼,然后再也没进去过,后来嫌弃开机要选择,就卸载了。。。。
& &340 天前
@ 谢谢已经解决了 L2TP 的问题
& &340 天前
直接买个 mac 。。完美解决。。。
& &340 天前
@ 需要关闭 UEFI 安全模式才能正常加载一个模块,但是貌似主板 z97-k r2 重启的时候没有出现第四步的画面。
链接如下:`/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur`
& &340 天前
@ 还在学校,很多通讯需要通过 QQ 。
& &340 天前
@ 嘿嘿,学生预算有限
& &340 天前
@ 输不了中文是什么鬼? 现在是 2016 年么?
& &340 天前
@ 我能理解~我上大学的时候也是这样子,攒了好久的钱买了台 mac mini 开心了好久
& &340 天前
试试 Arch ,这些都有很多解决方案。
& &340 天前
@ 明年换成 Arch ,大部分问题已经解决了。
& &340 天前
“来呀,折腾呀,反正有大把时光”
& &340 天前
@ 网银,股票,还有不少政务网站需要兼容 IE 的浏览器。
& &340 天前
@ wine qq 输入不了中文,打字只能输入拼音。。。。。
或者把字在浏览器里打好,再复制到 wine qq 里
& &340 天前
以前用过的 workflow 是
- Windows 下虚拟机跑 Linux(no gui)
- ssh 连进虚拟机( mintty + mingw/mysys )
- samba 双向共享文件
好像现在时代变了,是 Docker 啥的..
& &340 天前 via iPhone
推荐 mint , win 转 linux 很快适应.
& &340 天前
多用,就适应了
& &340 天前
我觉得玩日常用 linux 的都是买不起 mac ,但又想转转系统环境的……
& &340 天前 via iPhone
没人推荐树莓派?
& &340 天前 via Android
@ linux 适合做开发,经常操作命令行更能体会到它的优势。 qq 是硬伤,习惯就好。
& &340 天前 via Android
@ 又被代表了
& &340 天前
读书的话,这个上网软件确实够恶心。但也不是说没办法。那就是通过扫描全校的局域网,看看是否有可以挂代理的机器。。。然后就可以免费上网了。
都在虚拟机呆了 1 年了,理应可以无缝适应 linux 啊。。
& &340 天前
用 mac ,很多 ubuntu 下能做的, mac 下也能做;
& &340 天前
@ 没错,这是最好的解决办法
& &340 天前
何必为难自己
& &340 天前
用 deepin ,就只把他当桌面环境
开发用 vagrant 等,不要在桌面环境搞服务器环境
需要时虚拟机开个 win7
& &340 天前
现在是想让我换回 windows 才不习惯。
& &340 天前
,推荐你看下王垠的博文
& &340 天前
上面有个朋友又推荐 vagrant 了。我要说的是,不要听他的!
如果你连虚拟机里的 linux 都用不到得心应手的地步,用 vagrant 能解决才怪了。
vagrant 就是对 vbox 做了一层封装,但是这东西是有学习成本的。
& &340 天前
您这地图炮太广了。 mac 他算老几啊,别自我感觉良好了。
& &340 天前
我就是用 linux 和 macOS , windows 使用 kvm 运行在后台就行了。
& &339 天前
@ - -!我就随便说说…… linux 对于日常工作一点都不便利而已~没 office 、没 QQ (可以考虑 webqq )、作为前端……没 PS 是个问题。然后 win 的路过~
& &321 天前 via Smartisan T1
@ 日常工作也得分什么工作吧,又不是人人是前端,你一句话直接把用 Linux 用户说成全是穷逼了,说话未免太随便
& · & 507 人在线 & 最高记录 3541 & · &
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.7.5 · 84ms · UTC 22:05 · PVG 06:05 · LAX 15:05 · JFK 18:05? Do have faith in what you're doing.PyCharm Community Edition 3.4.1 IronPython Crashes when I click debugger?
Related questions
PyCharm Community Edition 3.4.1 IronPython Crashes when I click debugger?
imported from
I am currently working on a project in Python which requires a connection on localhost over port 80. I am new to the language and really want to be able to debug my program. The Community Edition should support debugging according to the documentation.
Whenever I click debug, I get the following error. I have tried reinstalling PyCharm and Python itself. Any idea what's going on? Thanks.
"C:\Program Files (x86)\IronPython 2.7.1\ipy.exe" -X:Frames "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 3.4.1\helpers\pydev\pydevd.py" --multiproc --client 127.0.0.1 --port 65061 --file
"C:/Users/theNextThing/Desktop/College/FA 2014/CIT 280/parser/server.py"
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 3.4.1\helpers\pydev\pydevd.py", line 4, in &module&
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition
3.4.1\helpers\pydev\django_debug.py", line 6, in &module&
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 3.4.1\helpers\pydev\runfiles.py", line 5, in &module&
File "C:\Program Files (x86)\IronPython 2.7.1\Lib\unittest\__init__.py", line 64, in &module&
File "C:\Program Files (x86)\IronPython 2.7.1\Lib\unittest\main.py", line 7, in &module&
File "C:\Program Files (x86)\IronPython 2.7.1\Lib\unittest\runner.py", line 7, in &module&
File "C:\Program Files (x86)\IronPython 2.7.1\Lib\unittest\signals.py", line 1, in &module&
SystemError: The type initializer for 'IronPython.Modules.PythonSignal' threw an exception.
Process finished with exit code 1
See also questions close to this topic
I am referring to a code i copied from this form but i a looking to add/append mac in to a list.
mac = '00:00:00:'
for number in range(16**6):
hex_num = hex(number)[2:].zfill(6)
print("{}{}{}:{}{}:{}{}".format(mac,*hex_num))
I have a Connection object that is used to contain the read and write streams of asyncio connections:
class Connection(object):
def __init__(self, stream_in, stream_out):
object.__init__(self)
self.__in = stream_in
self.__out = stream_out
def read(self, n_bytes : int = -1):
return self.__in.read(n_bytes)
def write(self, bytes_ : bytes):
self.__out.write(bytes_)
yield from self.__out.drain()
On the server side, connected creates a Connection object every time a client connects, then reads 4 bytes.
def connected(stream_in, stream_out):
conn = Connection(stream_in, stream_out)
data = yield from conn.read(4)
print(data)
And on the client side, 4 bytes are written out.
@asyncio.coroutine
def client(loop):
conn = Connection(stream_in, stream_out)
yield from conn.write(b'test')
This works almost as expected, but I have to yield from every read and write call. I've tried yield froming from inside Connection:
def read(self, n_bytes : int = -1):
data = yield from self.__in.read(n_bytes)
return data
But rather than getting data, I get an output like
&generator object StreamReader.read at 0x&
If I call read and write from multiple places, I would prefer not to repeat the yield froms every time. How can I keep them inside Connection?
I'm building a Facebook Messenger bot in Python and my script for quick replies is not working event though I already know how to send simple text messages and generic templates. This is my code so far:
This one works:
"recipient": {
"id": user_id
"message": {
"text": "some text"
This one doesn't:
question = {
"recipient": {
"id": user_id
"message": {
"quick_replies": [{
"content_type": "location"
# "title": "RED",
# "text": "red",
# "payload": "red"
POST for both:
headers={"Content-Type": "application/json"}
requests.post('url', data = json.dumps(text), headers=headers)
requests.post('url', data = json.dumps(question), headers=headers)
In the example, title, text and payload are commented since I'm trying to make the script work with something as basic as location... but I keep receiving a response 400 for 'question'; 'text' works just fine.
Visual Studio Code.
Typescript files are compiled to JavaScript files with sourcemaps.
Generated launch.json:
"version": "0.2.0",
"configurations": [
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}"
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceRoot}"
Chrome is started with parameter: --remote-debugging-port=9222
However I still get
Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222
error in VSCode, when trying to debug with "Attach to Chrome" option.
I am just beginning my journey in Xamarin and right now, I am very confused as to where or how should I call
to be included in the debug.
It is a whole code for compressing a specific file in a given directory. I always thought that I had to call this specific .cs file or at least the class in it and so I believed that my application isn't really running.
Advanced thanks to anyone that would gladly answer my question! :)
I have a large flask application built inside a package called "MyApp" (exactly as shown here: )
According to the Flask documentation, the debug mode should enables the following features:
it activates the debugger
it activates the automatic reloader
it enables the debug mode on the Flask application.
At the beginning I've run my flask application with the following command and everything were worked fine:
export FLASK_APP=MyApp
export FLASK_DEBUG=1
Then I read about the correct way to setup a configuration system (including the debug mode).
So I created the following config.py file:
class Config(object):
DEBUG = False
class ProductionConfig(Config):
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
CONFIGS = {
"development": DevelopmentConfig,
"production": ProductionConfig,
"default": DevelopmentConfig
And in my application __init__.py file, I wrote:
app = Flask(__name__)
config_name = os.getenv('FLASK_CONFIGURATION', 'default')
app.config.from_object(CONFIGS[config_name])
Now, to run the application I enter a new command:
export FLASK_APP=MyApp
export FLASK_CONFIGURATION=development
Unfortunately, this time the debug mode did not activated at all..
No debugger or automatic reloader has been activated.
The only thing that has been changed was that app.debug is now equals to True.
I don't get it.. It looks like the DEBUG = TRUE is not working correctly.
Do you have any idea why does it happen?
I know the SpotfireControl Id value of an object and I want to access it via an Ironpython script. I looked at the API, but failed to find a method that can do it. Is there a way to achieve this?
Any help would be greatly appreciated.
So I've been tinkering around with IronPython for a while... I've managed to run very long scripts with no issues. But, when I started using sklearn, in the script below I started getting the exception : "Microsoft.Scripting.SyntaxErrorException: 'unexpected token 'append''" ...
Here's the script I'm trying to run
import numpy as np
from sklearn.naive_bayes import GaussianNB
def Predict(a,b):
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
Y = np.array([1, 1, 1, 0, 0, 0])
clfr = GaussianNB()
clfr.fit(X,Y)
return clfr.predict([[a, b]])
Here's the C# Code I'm using:
using System.Collections.G
using System.D
using System.D
using System.L
using System.T
using System.Threading.T
using System.Windows.F
using IronPython.H
using System.IO;
using IronPython.M
namespace Bayes
public partial class Form1 : Form
public Form1()
InitializeComponent();
void RunScript()
var IronPythonRuntime = Python.CreateRuntime();
var engine = IronPythonRuntime.GetEngine("Python");
var paths = engine.GetSearchPaths();
paths.Add(@"C:\Users\sushr\AppData\Local\Programs\Python\Python36\Lib");
paths.Add(@"C:\Users\sushr\AppData\Local\Programs\Python\Python36\Lib\site-packages");
engine.SetSearchPaths(paths);
dynamic loadpythonscript = IronPythonRuntime.UseFile("C:\\Users\\sushr\\PythExp\\bayes.py"); ///&--- Exception is reported here
textBox1.Text = loadpythonscript.Predict(1, -2) + "";
catch (FileNotFoundException ex)
MessageBox.Show(ex.ToString());
private void button1_Click(object sender, EventArgs e)
RunScript();
Thanks in advance ?
I write a program in Windows Forms to call python function by Iron-Python.
my code in python is(in Test.py file):
import sys
sys.path.append(r"C:\Program Files (x86)\IronPython 2.7\Lib")
import requests
import random
import json
import hmac
import urllib
import uuid
import time
import copy
import math
def start():
return ("start")
and my code in c#:
var options = new Dictionary&string, object&();
options["Frames"] =
options["FullFrames"] =
ScriptEngine engine = Python.CreateEngine(options);
var ipy = Python.CreateRuntime();
dynamic test = ipy.UseFile("Test.py");
textBox1.Text=test.start();
When run it, I get the following error:
An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.Dynamic.dll
Additional information: 'module' object has no attribute '_getframe
How to fix it?
Hy.. I need help. I have installed python 3.6 with anaconda 4.3. Now I installed openCv(3.3 version). I did everything correctly. But when I import that library to my project , it show error. BTW the openCv library is present in site packages folder(But there is little lock symbol, i dont know what is that mean). You can see in the pic that required pakg is present, but still its showing error...
Please help me get rid from that error.Please please
Autocomplete of python code in html templates in PyCharm not working and not even changing its color of python code. Is I have to change some settings?
How can I set this up correctly?
In .py python files its worked fine but not in html files (.html)
thanks in advance!
I have a python script that runs succesfully from within pycharm terminal, setup as a virtual enviroment, but not from the windows terminal. I haven't set any windows enviroment variables.
Python is throwing FileNotFoundError when the script is loading external text files.
I came across this thread:
and i think the working directory is not correct when running from the windows terminal.
I do not understand the discrepancy. What does Pycharm different than the windows terminal? and how do i fix it?

我要回帖

更多关于 pycharm 安装requests 的文章

 

随机推荐