欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳解python模塊pychartdir安裝及導(dǎo)入問題

 更新時間:2020年10月22日 12:03:18   作者:青絲一夜走  
這篇文章主要介紹了python模塊pychartdir導(dǎo)入問題,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下

在遷移別人寫好的腳本時,發(fā)現(xiàn)pychartdir沒有導(dǎo)入,腳本執(zhí)行報錯。以下是報錯內(nèi)容:

[modps@LGJF-ZYC5-MMSC-WEB02 ~]$ python /opt/aspire/product/modps/mopps/shell/dayreport_linux.py
/etc/host.conf: line 1: bad command `nospoof on'
Traceback (most recent call last):
 File "/opt/aspire/product/modps/mopps/shell/dayreport_linux.py", line 42, in <module>
 from pychartdir import *
ImportError: No module named pychartdir

之前使用的是pip來安裝模塊的,先安裝下pip:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py

然后開始下載pychartdir模塊:

[root@LGJF-ZYC5-MMSC-WEB02 ~]# pip install pychartdir
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
/etc/host.conf: line 1: bad command `nospoof on'
ERROR: Could not find a version that satisfies the requirement pychartdir (from versions: none)
ERROR: No matching distribution found for pychartdir

發(fā)現(xiàn)報錯了,報錯的大概意思為:未找到合適的版本。

那么就只好手動安裝了

1.從官方地址下載python版本的ChartDirector并解壓

https://www.advsofteng.com/download.html

# 使用lrzsz命令將下載的包傳遞到服務(wù)器上
[root@LGJF-ZYC5-MMSC-WEB02 ~]# tar -xf chartdir_python_linux_64.tar.gz

2.在python模塊安裝目錄下(/usr/lib/python2.7/site-packages)創(chuàng)建一個chartdirector的目錄

# 查看模塊安裝目錄
[root@LGJF-ZYC5-MMSC-WEB02 ~]# python
Python 2.7.5 (default, May 3 2017, 07:55:04) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages']
>>> 
[root@LGJF-ZYC5-MMSC-WEB02 ~]# cd /usr/lib/python2.7/site-packages
[root@LGJF-ZYC5-MMSC-WEB02 site-packages]# mkdir chartdirector
[root@LGJF-ZYC5-MMSC-WEB02 site-packages]# cd chartdirector
[root@LGJF-ZYC5-MMSC-WEB02 chartdirector]# pwd
/usr/lib/python2.7/site-packages/chartdirector

3.進(jìn)入解壓好的Chartdirector/ lib,將其下面的內(nèi)容拷貝到上邊創(chuàng)建的目錄下,同時在site-packages下創(chuàng)建一個chartdirector.pth,寫入chartdirector到文件中:

[root@LGJF-ZYC5-MMSC-WEB02 chartdirector]# cd
[root@LGJF-ZYC5-MMSC-WEB02 ~]# cd ChartDirector/lib/
[root@LGJF-ZYC5-MMSC-WEB02 lib]# cp -a ./* /usr/lib/python2.7/site-packages/chartdirector/
[root@LGJF-ZYC5-MMSC-WEB02 lib]# cd /usr/lib/python2.7/site-packages/
[root@LGJF-ZYC5-MMSC-WEB02 site-packages]# cat chartdirector.pth
chartdirector

4.打開python IDE,導(dǎo)入該模塊試試:

[root@LGJF-ZYC5-MMSC-WEB02 site-packages]# python
Python 2.7.5 (default, May 3 2017, 07:55:04) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pychartdir

5.運行腳本,執(zhí)行成功!

到此這篇關(guān)于python模塊pychartdir導(dǎo)入問題的文章就介紹到這了,更多相關(guān)python模塊pychartdir內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Python的網(wǎng)絡(luò)編程庫Gevent的安裝及使用技巧

    Python的網(wǎng)絡(luò)編程庫Gevent的安裝及使用技巧

    Gevent庫的奧義在于并發(fā)式的高性能網(wǎng)絡(luò)程序設(shè)計支持,這里我們將來講解Python的網(wǎng)絡(luò)編程庫Gevent的安裝及使用技巧,來看一下Gevent支持的多進(jìn)程程序編寫:
    2016-06-06
  • python?label與one-hot之間的互相轉(zhuǎn)換方式

    python?label與one-hot之間的互相轉(zhuǎn)換方式

    這篇文章主要介紹了python?label與one-hot之間的互相轉(zhuǎn)換方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-02-02
  • python繪制直線的方法

    python繪制直線的方法

    這篇文章主要為大家詳細(xì)介紹了python繪制直線的方法,繪制直線通用方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-06-06
  • python爬蟲之爬取筆趣閣小說升級版

    python爬蟲之爬取筆趣閣小說升級版

    筆趣有很多起點中文網(wǎng)的小說,該網(wǎng)站小說的更新速度稍滯后于起點中文網(wǎng)正版小說的更新速度。并且該網(wǎng)站只支持在線瀏覽,不支持小說打包下載。所以可以通過python爬取文本信息保存,從而達(dá)到下載的目的
    2021-09-09
  • python求素數(shù)示例分享

    python求素數(shù)示例分享

    這篇文章主要介紹了python求素數(shù)示例,打印出素數(shù)列表,需要的朋友可以參考下
    2014-02-02
  • Python機器學(xué)習(xí)NLP自然語言處理基本操作精確分詞

    Python機器學(xué)習(xí)NLP自然語言處理基本操作精確分詞

    本文是Python機器學(xué)習(xí)NLP自然語言處理系列文章,帶大家開啟一段學(xué)習(xí)自然語言處理 (NLP) 的旅程. 本文主要學(xué)習(xí)NLP自然語言處理基本操作之如何精確分詞
    2021-09-09
  • Django中如何用xlwt生成表格的方法步驟

    Django中如何用xlwt生成表格的方法步驟

    這篇文章主要介紹了Django中如何用xlwt生成表格的方法步驟,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-01-01
  • 淺談Python數(shù)學(xué)建模之?dāng)?shù)據(jù)導(dǎo)入

    淺談Python數(shù)學(xué)建模之?dāng)?shù)據(jù)導(dǎo)入

    數(shù)據(jù)導(dǎo)入是所有數(shù)模編程的第一步,比你想象的更重要。Python 語言中數(shù)據(jù)導(dǎo)入的方法很多。對于數(shù)學(xué)建模問題編程來說,選擇什么方法最好呢?答案是:沒有最好的,只有最合適的。對于不同的問題,不同的算法,以及所調(diào)用工具包的不同實現(xiàn)方法,對于數(shù)據(jù)就會有不同的要求
    2021-06-06
  • python模式 工廠模式原理及實例詳解

    python模式 工廠模式原理及實例詳解

    這篇文章主要介紹了python模式 工廠模式原理及實例詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2020-02-02
  • python 列表推導(dǎo)式使用詳解

    python 列表推導(dǎo)式使用詳解

    這篇文章主要介紹了python 列表推導(dǎo)式使用詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2019-08-08

最新評論