pycharm远程连接linux开发
pycharm远程连接linux开发
首先,你得有一台装完python3环境的linux虚拟机(阿里云服务器,VMware Workstation建的本地虚拟机)
安装步骤:
# 第三方依赖库安装(如已安装,可以忽略) yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc gcc-c++ make yum -y install libffi-devel # 将下载好的Python-3.6.11.taz传到服务器 scp Python-3.6.11.taz :/home/ tar -zxvf Python-3.6.11.taz cd Python-3.6.11 # 创建一个python3的安装路径 mkdir -p /usr/local/python3 # 编译安装 ./configure --with-ssl --prefix=/usr/local/python3 make && make install # 删除原来的python2软连接&建立新的python3软连接 rm -rf /usr/bin/python ln -s /usr/local/python3/bin/python3.6 /usr/bin/python # 查看python的版本 [ bin]# ls -al|grep python [ bin]# python -V Python 3.6.11 [ bin]# python2 -V Python 2.7.5 [ bin]# # 更改yum对应的路径 vim /usr/bin/yum 将首行的python改成python2.7 # 如果在安装pip的过程中报错: SyntaxError: invalid syntax vim /usr/libexec/urlgrabber-ext-down 将首行的python改成python2.7 # pip安装 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py [ home]# python -m pip install --upgrade pip # 建立pip软连接 ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip # 添加path到环境变量 echo PATH=‘/usr/local/python/bin/:$PATH‘ >> /etc/profile source /etc/profile
step 1 随意打开一个项目
| Settings | Project: luffycity | Project Interpreter
step2 选择|Add|SSH Interpreter
输入主机名,用户名
step3 输入密码
点击next
step 4 设置本地代码文件保存路径,和远端代码保存路径
点击Finish
创建一个项目
运行项目
python 3.6遇到的问题:
File "/usr/local/python3/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 66, in <module> check_sqlite_version() File "/usr/local/python3/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 63, in check_sqlite_version raise ImproperlyConfigured(‘SQLite 3.8.3 or later is required (found %s).‘ % Database.sqlite_version) django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).
/usr/local/python3/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py
直接改源码
创建一个Django项目:
预准备工作
<1>在远端的映射路径中创建一个项目
[ project]# mkdir dolphinx [ project]# ls dolphinx test
<2>在本地路径中创建一个项目文件夹
E:\project-138>mkdir dolphin
创建流程:
step1 选择new project
step2 选择本地路径、远端解释器、远端映射路径
现在项目就创建成功了
项目测试:
可以发现pycharm会给我们定时的上传代码
但是这个时间不是我们所能掌握的
手动上传与下载
方式1
方式2
相关推荐
huavhuahua 2020-11-20
weiiron 2020-11-16
cakecc00 2020-11-15
千锋 2020-11-15
JakobHu 2020-11-14
guangcheng 2020-11-13
xirongxudlut 2020-11-10
solarLan 2020-11-09
pythonxuexi 2020-11-08
文山羊 2020-11-07
susmote 2020-11-07
wuShiJingZuo 2020-11-05
Pythonjeff远 2020-11-06
jacktangj 2020-11-04
lousir 2020-11-04
Noneyes 2020-11-10
ailxxiaoli 2020-11-16
chensen 2020-11-14
Nostalgiachild 2020-11-13