2016-03-29 19 views
3

Ubuntu 15.10 PC'mde sanal bir ortam kurmaya çalışıyorum.AttributeError: sanal ortamda bir paket yüklemeye çalışırken install_layout

Aşağıda
virtualenv python 
source python/bin/activate 
pip install ujson 

(alt yarısı) 'dir ~/.pip/pip.log içeriği:

running build                  

running build_ext                 

building 'ujson' extension              

creating build                 

creating build/temp.linux-x86_64-2.7            

creating build/temp.linux-x86_64-2.7/python          

creating build/temp.linux-x86_64-2.7/lib           

distcc clang-3.7 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/usr/include/python2.7 -c ./python/ujson.c -o build/temp.linux-x86_64-2.7/./python/ujson.o -D_GNU_SOURCE 

distcc clang-3.7 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/usr/include/python2.7 -c ./python/objToJSON.c -o build/temp.linux-x86_64-2.7/./python/objToJSON.o -D_GNU_SOURCE 

distcc clang-3.7 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/usr/include/python2.7 -c ./python/JSONtoObj.c -o build/temp.linux-x86_64-2.7/./python/JSONtoObj.o -D_GNU_SOURCE 

distcc clang-3.7 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/usr/include/python2.7 -c ./lib/ultrajsonenc.c -o build/temp.linux-x86_64-2.7/./lib/ultrajsonenc.o -D_GNU_SOURCE 

distcc clang-3.7 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/usr/include/python2.7 -c ./lib/ultrajsondec.c -o build/temp.linux-x86_64-2.7/./lib/ultrajsondec.o -D_GNU_SOURCE 

creating build/lib.linux-x86_64-2.7            

gcc -pthread -shared build/temp.linux-x86_64-2.7/./python/ujson.o build/temp.linux-x86_64-2.7/./python/objToJSON.o build/temp.linux-x86_64-2.7/./python/JSONtoObj.o build/temp.linux-x86_64-2.7/./lib/ultrajsonenc.o build/temp.linux-x86_64-2.7/./lib/ultrajsondec.o -L/usr/lib -lpython2.7 -o build/lib.linux-x86_64-2.7/ujson.so 

running install_lib                

Traceback (most recent call last):            

    File "<string>", line 1, in <module>           

    File "/tmp/pip-build-v2tojT/ujson/setup.py", line 69, in <module>    

    classifiers=CLASSIFIERS,              

    File "/usr/lib/python2.7/distutils/core.py", line 151, in setup     

    dist.run_commands()               

    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands   

    self.run_command(cmd)               

    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command   

    cmd_obj.run()                 

    File "/home/quant/python/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run 

    return orig.install.run(self)             

    File "/usr/lib/python2.7/distutils/command/install.py", line 575, in run  

    self.run_command(cmd_name)             

    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command   

    self.distribution.run_command(command)          

    File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command   

    cmd_obj.ensure_finalized()             

    File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized  

    self.finalize_options()              

    File "/home/quant/python/lib/python2.7/site-packages/setuptools/command/install_lib.py", line 17, in finalize_options 

    self.set_undefined_options('install',('install_layout','install_layout'))  

    File "/usr/lib/python2.7/distutils/cmd.py", line 302, in set_undefined_options 

    getattr(src_cmd_obj, src_option))            

    File "/usr/lib/python2.7/distutils/cmd.py", line 105, in __getattr__   

    raise AttributeError, attr             

AttributeError: install_layout             

----------------------------------------           
Cleaning up...                 
Command /home/quant/python/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-v2tojT/ujson/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rkdmJT-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/quant/python/include/site/python2.7 failed with error code 1 in /tmp/pip-build-v2tojT/ujson 
Exception information:               
Traceback (most recent call last):            
    File "/home/quant/python/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main 
    status = self.run(options, args)            
    File "/home/quant/python/lib/python2.7/site-packages/pip/commands/install.py", line 309, in run 
    requirement_set.install(install_options, global_options, root=options.root_path) 
    File "/home/quant/python/lib/python2.7/site-packages/pip/req.py", line 1436, in install 
    requirement.install(install_options, global_options, *args, **kwargs)   
    File "/home/quant/python/lib/python2.7/site-packages/pip/req.py", line 707, in install 
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False) 
    File "/home/quant/python/lib/python2.7/site-packages/pip/util.py", line 716, in call_subprocess 
    % (command_desc, proc.returncode, cwd))          
InstallationError: Command /home/quant/python/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-v2tojT/ujson/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rkdmJT-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/quant/python/include/site/python2.7 failed with error code 1 in /tmp/pip-build-v2tojT/ujson 

Bazı belki yararlı bilgi:

(python)[email protected]:~$ pip --version 
pip 1.5.6 from /home/quant/python/lib/python2.7/site-packages (python 2.7) 
(python)[email protected]:~$ which python 
/home/quant/python/bin/python 
(python)[email protected]:~$ python --version 
Python 2.7.10 

benim ev dizinden, aşağıdaki komutları çalıştırıp Benzer sonuçları olan diğer paketleri (örneğin, numpy) yüklemeyi denedim; derleme biter, ancak install_lib'u çalıştırmaya çalıştığında patlar.

cevap

19

Kurulum kitaplarını güncelleştirmeyi denediniz mi?

pip install -U setuptools

Ve sonra: Yine bu sorunu Ubuntu 16.04 güncellendi ve benim VIRTUALENV nuking ve sıfırdan başladıktan sonra, görmedik pip install ujson

+0

Bu soruya bir cevap vermemektedir. Yeterli [itibara] sahip olduğunuz zaman (http://stackoverflow.com/help/whats-reputation) herhangi bir gönderiye yorum yapabilirsiniz (http://stackoverflow.com/help/privileges/comment); bunun yerine, [askerden açıklama istemeyen cevaplar verin] (http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- i-do-yerine). - [Yorum yaz] (/ review/düşük kaliteli yazılar/12391585) – Rakete1111

+0

@ Rakete1111: Bu bir soru olarak ifade edilmiş olsa da, OP'nin sorununu nasıl çözebileceğine dair bir öneridir. Oy veririm – gariepy

+0

@gariepy bana göre, nedenini açıklamıyor ve bu yüzden bir yorum olmalı – Rakete1111

İlgili konular