pycharm使用错误排查

1.pip安装扩展包报错

复制代码
    creating build/temp.linux-x86_64-3.4
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/include -I/usr/include/python3.4m -c _mssql.c -o build/temp.linux-x86_64-3.4/_mssql.o -DMSDBLIB
    _mssql.c:8:22: fatal error: pyconfig.h: No such file or directory
     #include "pyconfig.h"
                          ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
View Code
复制代码

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

 安装扩展包

复制代码
kamil@vm-ubuntu:~$ sudo apt-get install python3-dev
[sudo] password for kamil: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libexpat1-dev libpython3-dev libpython3.4 libpython3.4-dev python3.4-dev
The following NEW packages will be installed:
  libexpat1-dev libpython3-dev libpython3.4 libpython3.4-dev python3-dev
  python3.4-dev
0 upgraded, 6 newly installed, 0 to remove and 64 not upgraded.
Need to get 19.6 MB of archives.
After this operation, 36.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libpython3.4 amd64 3.4.3-1ubuntu1~14.04.3 [1,308 kB]
复制代码

 2.pip升级

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
kamil@vm-ubuntu:~$ sudo pip install --upgrade pip
[sudo] password for kamil:
The directory '/home/kamil/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 7.1.0, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The directory '/home/kamil/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 90kB/s
Installing collected packages: pip
  Found existing installation: pip 7.1.0
    Uninstalling pip-7.1.0:
      Successfully uninstalled pip-7.1.0
Successfully installed pip-8.1.1
kamil@vm-ubuntu:~$

3.Command "python setup.py egg_info" failed with error code 1 in

请问

4.error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

You need to install the FreeTDS development package (freetds-dev) before trying to install pymssql with pip:
$ sudo apt-get install freetds-dev
sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip
and then, in your virtualenv or wherever you wish to install it:
$ pip install pymssql
复制代码
kamil@vm-ubuntu:~$ sudo pip install pymssql
The directory '/home/kamil/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/kamil/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pymssql
  Downloading pymssql-2.1.2.tar.gz (898kB)
    100% |████████████████████████████████| 901kB 59kB/s 
Installing collected packages: pymssql
  Running setup.py install for pymssql ... done
Successfully installed pymssql-2.1.2
kamil@vm-ubuntu:~$ 
复制代码

 5.error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).

请问

 6.lxml安装报错

复制代码
    compilation terminated.
    *********************************************************************************
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    *********************************************************************************
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of lxml
Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-j1bywhpx/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-vz905g9u-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-j1bywhpx/lxml/
View Code
复制代码

解决:

1 apt-get install libxml2-dev;
2 apt-get install libxslt1-dev;
3 sudo pip install lxml --upgrade

 7.MySQL-Python模块

sudo apt-get install libmysqlclient-dev
yum install python-devel mysql-devel
posted @   侠之大者kamil  阅读(4139)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· 现代计算机视觉入门之:什么是图片特征编码
· .NET 9 new features-C#13新的锁类型和语义
· Linux系统下SQL Server数据库镜像配置全流程详解
· 现代计算机视觉入门之:什么是视频
· 你所不知道的 C/C++ 宏知识
阅读排行:
· 不到万不得已,千万不要去外包
· C# WebAPI 插件热插拔(持续更新中)
· 会议真的有必要吗?我们产品开发9年了,但从来没开过会
· 【译】我们最喜欢的2024年的 Visual Studio 新功能
· 如何打造一个高并发系统?
点击右上角即可分享
微信分享提示