Linux系统下python开发环境搭建(Anaconda+Pycharm安装)
Linux环境下python中 Keras深度学习环境搭建基础介绍安装Anaconda安装libpython安装Theano安装Keras基础介绍Keras是一个模型级的库,提供了快速构建深度学习网络的模块。Keras并不处理如张量乘法、卷积等底层操作。这些操作依赖于某种特定的、优化良好的张量操作库。Keras依赖于处理张量的库就称为“后端引擎”。Keras提供了三种后端引擎Theano/Te..
Linux系统下python开发环境搭建(Anaconda+Pycharm安装)
本人是在Redhat6.8 64位系统下 anaconda 对应python3.6版:Anaconda3-5.2.0-Linux-x86_64.sh 。
在anaconda包安装以后python环境下已集成大多常用的基础开发包,因此推荐anaconda python安装后,再安装其它深度学习等需要的扩展包。
anaconda和python对应版本可以从下面链接查找:
https://docs.anaconda.com/anaconda/packages/oldpkglists/
安装Anaconda
anaconda下载地址:
清华镜像 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
中科大镜像 https://mirrors.ustc.edu.cn/anaconda/archive/
https://repo.continuum.io/archive/
官网 https://www.anaconda.com/distribution/ (最新版)
下载后,打开terminal,转到下载包所在目录 。
输入待安装的包名,运行,执行./Anaconda3-5.2.0-Linux-x86_64.sh ,具体如下:
[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
从下面网址下载安装包,选择系统和版本(Professional :专家版试用后需付费 或 Community 社区版免费)。一般选择Community版就够用了。
下载地址: https://www.jetbrains.com/pycharm/download/
查看Install-Linux-tar.txt 详细介绍了安装过程
====
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 界面,勾选接受即可直接进行软件运行界面。没有网上其它人的配置过程。则配置环境变量实现命令行直接运行, 设置桌面快捷方式均需要后来手动完成。
创建桌面快捷链接可以采用建立软链接的方法,请参考:Linux创建桌面快捷方式的三种方法
方法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
或 点击快捷方式 就可以运行了。
更多推荐
所有评论(0)