Ubuntu使用pycharm
官网地址
这里以Ubuntu1604 LTS----下载pycharm-community-2021.2.1.tar
解压安装
sudo tar -zxvf pycharm-community-2021.2.1.tar -C /usr/local
cd /usr/local/pycharm2021.2.1/bin
#安装
./pycharm.sh
打开后直接锁定到侧边栏(在侧边栏右键–lock to launcher)or 创建桌面
或者配置桌面应用 pycharm.desktop
[Desktop Entry]
Type=Application
Name=Pycharm
GenericName=Pycharm3
Comment=Pycharm3:The Python IDE
Exec="/home/lauf1/.software/pycharm-community-2019.3.1/bin/pycharm.sh" %f
Icon=/home/lauf1/.software/pycharm-community-2019.3.1/bin/pycharm.png
Terminal=pycharm
Categories=Pycharm;
然后更改文件的可执行权限,双击即可执行。
将该文件复制到~/.local/share/applications/,然后点击桌面左下角‘显示应用程序’,搜索‘pycharm’,右键‘添加到收藏夹’。
使用pycharm
-
创建项目file>new project
-
配置编辑内容字体大小
file>settings>editor>font
这里Ctrl+ 展开代码 Ctrl- 折叠代码 -
为项目配置python解释器
打开一个项目后,可以为它配置不同的python解释器
-
代码自动补全
默认可以自动补全 -
设置鼠标滚轮,控制字体大小
file–settings----keymap— 搜索increase、decrease—双击
-
快捷键
Ctrl + F 查找
Ctrl + R 替换
其他参考
windows 使用Pycharm
若配置的环境与控制台不一致
# 查看的还是全局的环境
pip list
- 是否有中文路径;
- 虚拟环境是否继承全局;
- 使用venv\Scripts\pip list; 此时应注意pip-script.py、pip3-script.py、pip3.6-script.py中的第一行的解释器的路径问题。
pip install cryptography 报错
可以解决sha256_password的问题!!
This package requires Rust >=1.41.0
If you are seeing a compilation error please try the following steps to successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust
Python: 3.6.5
platform: Windows-10-10.0.19041-SP0
pip: 21.3.1
setuptools: 59.6.0
setuptools_rust: 1.1.2
解决:
下载 rustup,并安装;pip install cryptography
error: cargo failed with code: 101
更新pip: python -m pip install --upgrade pip
AttributeError: ‘NoneType’ object has no attribute ‘bytes’---------再次更新pip
最后安装cryptography
python -m pip install cryptography
成功!
- 安装python-alipay-sdk(支付宝开发工具)
#顺序安装
pip install cryptography
pip install pyopenssl
pip install python-alipay-sdk