setuptools

Linux 安装 python 及其他

柔情痞子 提交于 2020-03-29 23:12:24
>>配置网络 TYPE=Ethernet #网卡类型 DEVICE=eth0 #网卡接口名称 ONBOOT=yes #系统启动时是否自动加载 BOOTPROTO=static #启用地址协议 --static:静态协议 --bootp协议 --dhcp协议 IPADDR=192.168.1.11 #网卡IP地址 NETMASK=255.255.255.0 #网卡网络地址 GATEWAY=192.168.1.1 #网卡网关地址 DNS1=10.203.104.41 #网卡DNS地址 HWADDR=00:0C:29:13:5D:74 #网卡设备MAC地址 BROADCAST=192.168.1.255 #网卡广播地址 /etc/init.d/network reload --启动; ifup,ifdown;service network xxx; netstat -r //查看路由网关等信息; >>yum--本地源--so mount -o loop /dev/cdrom /media/CentOS baseurl=file:///media/CentOS/ >>安装vim,gcc,gcc-c++, --出现以下错误, Python build finished, but the necessary bits to build these modules were not found

Ubuntu-Python2.7安装 scipy,numpy,matplotlib 和pip

∥☆過路亽.° 提交于 2020-03-23 13:04:46
一、 scipy,numpy,matplotlib sudo apt-get install python-scipy sudo apt-get install python-numpy sudo apt-get install python-matplotlib python import scipy import numpy import pylab scipy.test() numpy.test() pylab.test() 二、pip 1、先说一下什么是pippip 是“A tool for installing and managing Python packages.”,也就是说pip是python的软件安装工具2、下面介绍怎么在linux下安装pip下载pip到/usr/local/src# cd /usr/local/src# wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate如果提示:-bash: wget: command not found那么安装wget,执行如下:# yum -y install wget 解夺安装pip# tar -xzvf pip

How do I get the current 'package' name? (setup.py)

放肆的年华 提交于 2020-03-22 08:05:59
问题 How do I get the current topmost package, i.e., the name defined in setup.py? Here is my tree : . |-- README.md |-- the_project_name_for_this_pkg | |-- __init__.py | |-- __main__.py | |-- _config | | `-- foo.conf | |-- _data | | `-- logging.yml | `-- tests | |-- __init__.py | `-- test_foo.py <--- # executing from here |-- requirements.txt `-- setup.py 4 directories, 9 files The only solution I've gotten to work so far is this: import os import sys os.path.basename(sys.path[1]) But this is

How do I get the current 'package' name? (setup.py)

落花浮王杯 提交于 2020-03-22 08:03:10
问题 How do I get the current topmost package, i.e., the name defined in setup.py? Here is my tree : . |-- README.md |-- the_project_name_for_this_pkg | |-- __init__.py | |-- __main__.py | |-- _config | | `-- foo.conf | |-- _data | | `-- logging.yml | `-- tests | |-- __init__.py | `-- test_foo.py <--- # executing from here |-- requirements.txt `-- setup.py 4 directories, 9 files The only solution I've gotten to work so far is this: import os import sys os.path.basename(sys.path[1]) But this is

KeyError / frozen importlib._bootstrap error on second library import in spyder

五迷三道 提交于 2020-03-22 07:09:02
问题 I receive a File " <frozen importlib._bootstrap_external> ", line 978, in _get_parent_path KeyError: 'python_library' error when I import a library from a subfolder the second time in spyder, but the first time (after restarting spyder) or outside of spyder it works fine. The code is: from python_library.tools.test_lib import test_func test_func() where test_lib.py is simply def test_func(): print('Hello!') And the output is: runfile('/home/user/Desktop/test.py', wdir='/home/user/Desktop')

KeyError / frozen importlib._bootstrap error on second library import in spyder

我与影子孤独终老i 提交于 2020-03-22 07:07:24
问题 I receive a File " <frozen importlib._bootstrap_external> ", line 978, in _get_parent_path KeyError: 'python_library' error when I import a library from a subfolder the second time in spyder, but the first time (after restarting spyder) or outside of spyder it works fine. The code is: from python_library.tools.test_lib import test_func test_func() where test_lib.py is simply def test_func(): print('Hello!') And the output is: runfile('/home/user/Desktop/test.py', wdir='/home/user/Desktop')

setuptools, know in advance the wheel filename of a native library

三世轮回 提交于 2020-03-22 05:50:40
问题 Is there an easy way to know the filename of a Python wheel before running the setup script? I'm trying to generate a Bazel rule that builds a .whl for each Python version installed in the machine, the library contains native code so it needs to be compiled for each version separately. The thing with Bazel is that it requires to declare any outputs in advance, and what I'm observing is that each Python version generates a different filename without obvious consistency (different prefixes for

setuptools, know in advance the wheel filename of a native library

佐手、 提交于 2020-03-22 05:50:06
问题 Is there an easy way to know the filename of a Python wheel before running the setup script? I'm trying to generate a Bazel rule that builds a .whl for each Python version installed in the machine, the library contains native code so it needs to be compiled for each version separately. The thing with Bazel is that it requires to declare any outputs in advance, and what I'm observing is that each Python version generates a different filename without obvious consistency (different prefixes for

CentOS升级Python2.7及安装pip

◇◆丶佛笑我妖孽 提交于 2020-03-22 05:40:59
*/ /*--> */ CentOS升级Python2.7及安装pip CentOS升级Python2.7及安装pip 1) 升级Python2.7 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 python -V # 查看版本:Python 2.6 . 6 mkdir -p ~/Env/python; cd ~/Env/python # 创建个目录 wget --no-check-certificate https: //www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz tar Jxvf Python- 2.7 . 6 .tar.xz cd Python- 2.7 . 6 ./configure --prefix=/usr/local/py- 2.7 . 6 # "./configure -h" 查看帮助 make # 报模块缺失时,有需要的安装后重make # issue: INFO: Can't locate Tcl/Tk libs and/or headers # Python build finished, but the necessary bits to build these

Cythonize but not compile .pyx files using setup.py

▼魔方 西西 提交于 2020-03-22 04:36:01
问题 I have a Cython project containing several .pyx files. To distribute my project I would like to provide my generated .c files as recommended in the Cython documentation, to minimize problems with different Cython versions. My current work flow is to build the project using: me@machine$ python setup.py build_ext --inplace This cythonizes (i.e. translate .pyx files to .c / .cpp files using Cython) all .pyx files and then compiles them. For a release I do not need the compiled ( .so ) files, so