找不到所需的PyGTK - 修复路径

时间:2015-01-29 06:07:07

标签: pygtk centos6 virtualenvwrapper

我尝试运行Nicotine.py但很难启动它.. 这是我在Centos 6.6 64bit上正确启动.py程序的所有操作。 在这里尝试了一切之后

https://www.centos.org/forums/viewtopic.php?f=14&t=50831

我终于有了这个错误:

Can not find required PyGTK. The current search path is 
['/root/Downloads/nicotine+-1.2.16', '/opt/virtual_env/temp/lib64/python26.zip', '/opt/virtual_env/temp/lib64/python2.6', '/opt/virtual_env/temp/lib64/python2.6/plat-linux2', '/opt/virtual_env/temp/lib64/python2.6/lib-tk', '/opt/virtual_env/temp/lib64/python2.6/lib-old', '/opt/virtual_env/temp/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6', '/usr/lib/python2.6', '/opt/virtual_env/temp/lib/python2.6/site-packages']
Exception: No module named pygtk

我不知道如何改变路径。 Nicotine.py文件夹在/root/Downloads/nicotine+-1.2.16中,但是下面的代码中的操作是错误的

    [root@test nicotine+-1.2.16]# sudo yum install python-gtk2 python-glade2
Loaded plugins: fastestmirror, refresh-packagekit
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.sov.uk.goscomb.net
 * epel: ftp.nluug.nl
 * extras: mirror.ox.ac.uk
 * rpmforge: ftp.nluug.nl
 * updates: mirrors.coreix.net
No package python-gtk2 available.
No package python-glade2 available.
Error: Nothing to do
[root@test nicotine+-1.2.16]# sudo pip install PyGTK
sudo: pip: command not found
[root@test nicotine+-1.2.16]# yum -y install python-pip
Loaded plugins: fastestmirror, refresh-packagekit
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.sov.uk.goscomb.net
 * epel: nl.mirror.eurid.eu
 * extras: mirrors.coreix.net
 * rpmforge: nl.mirror.eurid.eu
 * updates: mirrors.coreix.net
Resolving Dependencies
--> Running transaction check
---> Package python-pip.noarch 0:1.3.1-4.el6 will be installed
--> Processing Dependency: python-setuptools for package: python-pip-1.3.1-4.el6.noarch
--> Running transaction check
---> Package python-setuptools.noarch 0:0.6.10-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================
 Package                Arch        Version            Repository
                                                                  Size
=======================================================================
Installing:
 python-pip             noarch      1.3.1-4.el6        epel      330 k
Installing for dependencies:
 python-setuptools      noarch      0.6.10-3.el6       base      336 k

Transaction Summary
=======================================================================
Install       2 Package(s)

Total download size: 666 k
Installed size: 2.5 M
Downloading Packages:
(1/2): python-pip-1.3.1-4.el6.noarch.rpm        | 330 kB     00:00     
(2/2): python-setuptools-0.6.10-3.el6.noarch.rp | 336 kB     00:00     
-----------------------------------------------------------------------
Total                                  3.7 MB/s | 666 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : python-setuptools-0.6.10-3.el6.noarch               1/2 
  Installing : python-pip-1.3.1-4.el6.noarch                       2/2 
  Verifying  : python-pip-1.3.1-4.el6.noarch                       1/2 
  Verifying  : python-setuptools-0.6.10-3.el6.noarch               2/2 

Installed:
  python-pip.noarch 0:1.3.1-4.el6                                      

Dependency Installed:
  python-setuptools.noarch 0:0.6.10-3.el6                              

Complete!
[root@test nicotine+-1.2.16]# echo 'alias pip="/usr/bin/pip-python"' >> $HOME/.bashrc
[root@test nicotine+-1.2.16]# . $HOME/.bashrc
[root@test nicotine+-1.2.16]# sudo pip install PyGTK
Downloading/unpacking PyGTK
  Downloading pygtk-2.24.0.tar.bz2 (2.4MB): 2.4MB downloaded
  Running setup.py egg_info for package PyGTK
    ********************************************************************
    * Building PyGTK using distutils is only supported on windows. *
    * To build PyGTK in a supported way, read the INSTALL file.    *
    ********************************************************************
    Complete output from command python setup.py egg_info:
    ********************************************************************

* Building PyGTK using distutils is only supported on windows. *

* To build PyGTK in a supported way, read the INSTALL file.    *

********************************************************************

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/PyGTK
Storing complete log in /root/.pip/pip.log
[root@test nicotine+-1.2.16]# pip install virtualenvwrapper
Downloading/unpacking virtualenvwrapper
  Downloading virtualenvwrapper-4.3.2.tar.gz (86kB): 86kB downloaded
  Running setup.py egg_info for package virtualenvwrapper

    Installed /tmp/pip-build-root/virtualenvwrapper/pbr-0.10.7-py2.6.egg
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found
    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no files found matching '*.html' under directory 'docs'
    warning: no files found matching '*.css' under directory 'docs'
    warning: no files found matching '*.js' under directory 'docs'
    warning: no files found matching '*.png' under directory 'docs'
Downloading/unpacking virtualenv (from virtualenvwrapper)
  Downloading virtualenv-12.0.6.tar.gz (1.8MB): 1.8MB downloaded
  Running setup.py egg_info for package virtualenv
    warning: no previously-included files matching '*' found under directory 'docs/_templates'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
Downloading/unpacking virtualenv-clone (from virtualenvwrapper)
  Downloading virtualenv-clone-0.2.5.tar.gz
  Running setup.py egg_info for package virtualenv-clone
Downloading/unpacking stevedore (from virtualenvwrapper)
  Downloading stevedore-1.2.0.tar.gz (352kB): 352kB downloaded
  Running setup.py egg_info for package stevedore

    Installed /tmp/pip-build-root/stevedore/pbr-0.10.7-py2.6.egg
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found
    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no files found matching '*.rst' under directory 'docs'
    warning: no files found matching '*.py' under directory 'docs'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no files found matching '*.css' under directory 'docs'
    warning: no files found matching '*.js' under directory 'docs'
    warning: no files found matching '*.png' under directory 'docs'
    warning: no files found matching '*.txt' under directory 'docs'
    warning: no files found matching '*.jpg' under directory 'docs'
    warning: no files found matching '*.py' under directory 'tests'
Downloading/unpacking pbr>=0.6,!=0.7,<1.0 (from stevedore->virtualenvwrapper)
  Downloading pbr-0.10.7.tar.gz (82kB): 82kB downloaded
  Running setup.py egg_info for package pbr
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found
    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking argparse (from stevedore->virtualenvwrapper)
  Downloading argparse-1.3.0.tar.gz (93kB): 93kB downloaded
  Running setup.py egg_info for package argparse
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    warning: no previously-included files matching '*.orig' found anywhere in distribution
    warning: no previously-included files matching '*.rej' found anywhere in distribution
    no previously-included directories found matching 'doc/_build'
    no previously-included directories found matching 'env24'
    no previously-included directories found matching 'env25'
    no previously-included directories found matching 'env26'
    no previously-included directories found matching 'env27'
Downloading/unpacking six>=1.7.0 (from stevedore->virtualenvwrapper)
  Downloading six-1.9.0.tar.gz
  Running setup.py egg_info for package six
    no previously-included directories found matching 'documentation/_build'
Requirement already satisfied (use --upgrade to upgrade): pip in /usr/lib/python2.6/site-packages (from pbr>=0.6,!=0.7,<1.0->stevedore->virtualenvwrapper)
Installing collected packages: virtualenvwrapper, virtualenv, virtualenv-clone, stevedore, pbr, argparse, six
  Running setup.py install for virtualenvwrapper
    [pbr] Reusing existing SOURCES.txt
    changing mode of build/scripts-2.6/virtualenvwrapper.sh from 644 to 755
    changing mode of build/scripts-2.6/virtualenvwrapper_lazy.sh from 644 to 755
    Skipping installation of /usr/lib/python2.6/site-packages/virtualenvwrapper/__init__.py (namespace package)
    Installing /usr/lib/python2.6/site-packages/virtualenvwrapper-4.3.2-py2.6-nspkg.pth
    changing mode of /usr/bin/virtualenvwrapper.sh to 755
    changing mode of /usr/bin/virtualenvwrapper_lazy.sh to 755
  Running setup.py install for virtualenv
    warning: no previously-included files matching '*' found under directory 'docs/_templates'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    Installing virtualenv script to /usr/bin
    Installing virtualenv-2.6 script to /usr/bin
  Running setup.py install for virtualenv-clone
    Installing virtualenv-clone script to /usr/bin
  Running setup.py install for stevedore
    [pbr] Reusing existing SOURCES.txt
  Running setup.py install for pbr
    [pbr] Reusing existing SOURCES.txt
    Installing pbr script to /usr/bin
  Running setup.py install for argparse
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    warning: no previously-included files matching '*.orig' found anywhere in distribution
    warning: no previously-included files matching '*.rej' found anywhere in distribution
    no previously-included directories found matching 'doc/_build'
    no previously-included directories found matching 'env24'
    no previously-included directories found matching 'env25'
    no previously-included directories found matching 'env26'
    no previously-included directories found matching 'env27'
  Running setup.py install for six
    no previously-included directories found matching 'documentation/_build'
Successfully installed virtualenvwrapper virtualenv virtualenv-clone stevedore pbr argparse six
Cleaning up...
[root@test nicotine+-1.2.16]# export WORKON_HOME=$HOME/.virtualenvs
[root@test nicotine+-1.2.16]# export PROJECT_HOME=$HOME/Devel
[root@test nicotine+-1.2.16]# source /usr/local/bin/virtualenvwrapper.sh
bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
[root@test nicotine+-1.2.16]# source ~/.bashrc
[root@test nicotine+-1.2.16]# workon
bash: workon: command not found
[root@test nicotine+-1.2.16]# export WORKON_HOME=$HOME/.virtualenvs
[root@test nicotine+-1.2.16]# export PROJECT_HOME=$HOME/Devel
[root@test nicotine+-1.2.16]# export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh
[root@test nicotine+-1.2.16]# source /usr/local/bin/virtualenvwrapper_lazy.sh
bash: /usr/local/bin/virtualenvwrapper_lazy.sh: No such file or directory
[root@test nicotine+-1.2.16]# workon
bash: workon: command not found
[root@test nicotine+-1.2.16]# source .profile
bash: .profile: No such file or directory
[root@test nicotine+-1.2.16]# load virtualenvwrapper for python (after custom PATHs)
bash: syntax error near unexpected token `('
[root@test nicotine+-1.2.16]# venvwrap="virtualenvwrapper.sh"
[root@test nicotine+-1.2.16]# /usr/bin/which -s $venvwrap
/usr/bin/which: invalid option -- 's'
/usr/bin/virtualenvwrapper.sh
[root@test nicotine+-1.2.16]# if [ $? -eq 0 ]; then
>     venvwrap=`/usr/bin/which $venvwrap`
>     source $venvwrap
> fi
[root@test nicotine+-1.2.16]# source .bash_profile
bash: .bash_profile: No such file or directory
[root@test nicotine+-1.2.16]# .bashrc / .zshrc
bash: .bashrc: command not found
[root@test nicotine+-1.2.16]# source .bash_profile
bash: .bash_profile: No such file or directory
[root@test nicotine+-1.2.16]# source "/usr/bin/virtualenvwrapper.sh"
[root@test nicotine+-1.2.16]# export WORKON_HOME="/opt/virtual_env/"
[root@test nicotine+-1.2.16]# workon
NOTE: Virtual environments directory /opt/virtual_env/ does not exist. Creating...
[root@test nicotine+-1.2.16]# mkvirtualenv temp
New python executable in temp/bin/python
Installing setuptools, pip...done.
(temp)[root@test nicotine+-1.2.16]# workon
temp
(temp)[root@test nicotine+-1.2.16]# export PATH=/usr/local/bin:$PATH
(temp)[root@test nicotine+-1.2.16]# source /usr/local/bin/virtualenvwrapper.sh
bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
(temp)[root@test nicotine+-1.2.16]# export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
(temp)[root@test nicotine+-1.2.16]# export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
(temp)[root@test nicotine+-1.2.16]# source /usr/local/bin/virtualenvwrapper.sh
bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
(temp)[root@test nicotine+-1.2.16]# workon jack
ERROR: Environment 'jack' does not exist. Create it with 'mkvirtualenv jack'.
(temp)[root@test nicotine+-1.2.16]# sudo yum install python-gtk2 python-glade2
Loaded plugins: fastestmirror, refresh-packagekit
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.sov.uk.goscomb.net
 * epel: mirror.nl.leaseweb.net
 * extras: mirrors.coreix.net
 * rpmforge: mirror.nl.leaseweb.net
 * updates: mirrors.coreix.net
No package python-gtk2 available.
No package python-glade2 available.
Error: Nothing to do
(temp)[root@test nicotine+-1.2.16]# sudo pip install PyGTK
Downloading/unpacking PyGTK
  Running setup.py egg_info for package PyGTK
    ********************************************************************
    * Building PyGTK using distutils is only supported on windows. *
    * To build PyGTK in a supported way, read the INSTALL file.    *
    ********************************************************************
    Complete output from command python setup.py egg_info:
    ********************************************************************

* Building PyGTK using distutils is only supported on windows. *

* To build PyGTK in a supported way, read the INSTALL file.    *

********************************************************************

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/PyGTK
Storing complete log in /root/.pip/pip.log
(temp)[root@test nicotine+-1.2.16]# virtualenv -p /usr/bin/python2.7
The executable /usr/bin/python2.7 (from --python=/usr/bin/python2.7) does not exist
(temp)[root@test nicotine+-1.2.16]# virtualenv -p /usr/bin/python2.6
Running virtualenv with interpreter /usr/bin/python2.6
You must provide a DEST_DIR
Usage: virtualenv.py [OPTIONS] DEST_DIR

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -v, --verbose         Increase verbosity.
  -q, --quiet           Decrease verbosity.
  -p PYTHON_EXE, --python=PYTHON_EXE
                        The Python interpreter to use, e.g.,
                        --python=python2.5 will use the python2.5 interpreter
                        to create the new environment.  The default is the
                        interpreter that virtualenv was installed with
                        (/usr/bin/python2.6)
  --clear               Clear out the non-root install and start from scratch.
  --no-site-packages    DEPRECATED. Retained only for backward compatibility.
                        Not having access to global site-packages is now the
                        default behavior.
  --system-site-packages
                        Give the virtual environment access to the global
                        site-packages.
  --always-copy         Always copy files rather than symlinking.
  --unzip-setuptools    Unzip Setuptools when installing it.
  --relocatable         Make an EXISTING virtualenv environment relocatable.
                        This fixes up scripts and makes all .pth files
                        relative.
  --no-setuptools       Do not install setuptools (or pip) in the new
                        virtualenv.
  --no-pip              Do not install pip in the new virtualenv.
  --extra-search-dir=DIR
                        Directory to look for setuptools/pip distributions in.
                        This option can be used multiple times.
  --never-download      DEPRECATED. Retained only for backward compatibility.
                        This option has no effect. Virtualenv never downloads
                        pip or setuptools.
  --prompt=PROMPT       Provides an alternative prompt prefix for this
                        environment.
  --setuptools          DEPRECATED. Retained only for backward compatibility.
                        This option has no effect.
  --distribute          DEPRECATED. Retained only for backward compatibility.
                        This option has no effect.
(temp)[root@test nicotine+-1.2.16]# sudo pip install PyGTK
Downloading/unpacking PyGTK
  Running setup.py egg_info for package PyGTK
    ********************************************************************
    * Building PyGTK using distutils is only supported on windows. *
    * To build PyGTK in a supported way, read the INSTALL file.    *
    ********************************************************************
    Complete output from command python setup.py egg_info:
    ********************************************************************

* Building PyGTK using distutils is only supported on windows. *

* To build PyGTK in a supported way, read the INSTALL file.    *

********************************************************************

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/PyGTK
Storing complete log in /root/.pip/pip.log
(temp)[root@test nicotine+-1.2.16]# ./nicotine.py
Can not find required PyGTK. The current search path is 
['/root/Downloads/nicotine+-1.2.16', '/opt/virtual_env/temp/lib64/python26.zip', '/opt/virtual_env/temp/lib64/python2.6', '/opt/virtual_env/temp/lib64/python2.6/plat-linux2', '/opt/virtual_env/temp/lib64/python2.6/lib-tk', '/opt/virtual_env/temp/lib64/python2.6/lib-old', '/opt/virtual_env/temp/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6', '/usr/lib/python2.6', '/opt/virtual_env/temp/lib/python2.6/site-packages']
Exception: No module named pygtk
(temp)[root@test nicotine+-1.2.16]#

你可以帮助我逐步修复以避免pygtk错误吗?

0 个答案:

没有答案