Linux系统下python开发环境搭建(Anaconda+Pycharm安装)
Linux系统下python开发环境搭建(Anaconda+Pycharm安装)
pycharm community本⼈是在Redhat6.8 64位系统下 anaconda 对应python3.6版:Anaconda3-5.2.0-Linux-x86_64.sh 。
在anaconda包安装以后python环境下已集成⼤多常⽤的基础开发包,因此推荐anaconda python安装后,再安装其它深度学习等需要的扩展包。
安装Anaconda
[dhy@~]cd /mnt/hgfs/D/download/install_src/PythonPacket
[dhy@Master PythonPacket]$ ./Anaconda3-5.2.0-Linux-x86_64.sh
Welcome to Anaconda3 5.2.0
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
......
Do you accept the license terms?[yes|no]
[no]>>>
Please answer 'yes' or 'no':'
>>> yes
......
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/dhy/.bashrc ?[yes|no]
[no]>>>
You may wish to edit your .bashrc to prepend the Anaconda3 install location to PATH:
export PATH=/home/dhy/anaconda3/bin:$PATH
Thank you for installing Anaconda3!
[dhy@Master PythonPacket]$
由于没有及时跟进,默认选择anaaconda3安装⽬录不加⼊环境变量。则需要⼿动设置环境变量:
vim /etc/profile
在末尾加⼊ export PATH=/home/dhy/anaconda3/bin:$PATH 并更新 执⾏source (需要切换到root⽤户才有权限)
可以通过conda list查看安装的包。具体如下:
[root@Master Desktop]# source /etc/profile
[root@Master Desktop]# conda list
# packages in environment at /home/dhy/anaconda3:
#
# Name                    Version                  Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0            py36he11e457_0
alabaster                0.7.10          py36h306e16b_0
anaconda                  5.2.0                    py36_3
anaconda-client          1.6.14                  py36_0
anaconda-navigator        1.8.7                    py36_0
anaconda-project          0.8.2            py36h44fb852_0
asn1crypto                0.24.0                  py36_0
......
在终端输⼊python即可运⾏,提⽰python 3.6.5版。如下图:
安装Pycharm
====
Linux Installation Instructions
------------------------------------------------------------------------------
1. Unpack the PyCharm distribution archive that you downloaded to
where you wish to install the program. We will refer to this destination
location as your {installation home} below.
2. Open a console and cd into "{installation home}/bin" and type:
./pycharm.sh
to start the application. As a side effect,this will initialize various
configuration files in the ~/.PyCharmCE2019.1 directory.
3.[OPTIONAL] Add "{installation home}/bin" to your PATH environment
variable so that you may start PyCharm from any directory.
4.[OPTIONAL] To adjust the value of the JVM heap size, create
~/.PyCharmCE2019.1/config/pycharm.vmoptions(or pycharm64.vmoptions if using a 64-bit JDK), and set the -Xms and -Xmx parameters. To see how      to do this, you can reference the vmoptions file under
"{installation home}/bin"as a model.
[OPTIONAL] Changing the location of"config" and "system" directories
执⾏安装命令。进⼊pycharm解压⽂件夹的bin⽬录执⾏ ./pycharm.sh
安装配置过程。
由于第⼀次执⾏后弹出配置选项后,中断,下次打开后出现Jetbrains Privacy Policy 界⾯,勾选接受即
可直接进⾏软件运⾏界⾯。没有⽹上其它⼈的配置过程。则配置环境变量实现命令⾏直接运⾏, 设置桌⾯快捷⽅式均需要后来⼿动完成。
创建桌⾯快捷链接可以采⽤建⽴软链接的⽅法,请参考:
⽅法1: 在桌⾯上建⽴ jetbrains-pycharm-ce.desktop ⽂件添加类似下⾯⽂件内容。
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm Community Edition
Icon=/usr/local/software/pycharm-community-2019.1.1/bin/pycharm.svg
Exec="/usr/local/software/pycharm-community-2019.1.1/bin/pycharm.sh"%f
Comment=Python IDE for Professional Developers
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm-ce
⽅法2 创建软链接:
ln -s /usr/local/software/pycharm-community-2019.1.1/bin/pycharm.sh ~/Desktop
创建桌⾯快捷⽅式后,出现⽆JDK的提⽰界⾯。
本⼈已经在root ⽤户下安装过java了。经查看是当时环境变量是在home⽬录 .bashrc⽂件 设置的。
仅对登陆的⽤户有效。要使对所有⽤户⽣效,需要在 /etc/profile ⽬录下设置环境变量(需要有 ROOT⽤户权限):
注意: 需要在执⾏ "source /etc/profile"之后才能使环境变量⽣效;
现在运⾏ pycharm.sh或 点击快捷⽅式 就可以运⾏了。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。