Jump to content


P4Python installing error

p4python error commands API

  • Please log in to reply
1 reply to this topic

#1 Rita

Rita

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 05 May 2016 - 02:10 AM

My os is Linux mint ,I installed the p4python using this command: $ pip install p4python  
But I'm getting the error:
Downloading/unpacking p4python
  Downloading p4python-2015.2.1348262.tar.gz (81kB): 81kB downloaded
  Running setup.py (path:/tmp/pip_build_ontim/p4python/setup.py) egg_info for package p4python
	*******************************************
	** Building P4Python without SSL support **
	*******************************************
	Attempting to load API from ftp.perforce.com
	Loaded API into /tmp/p4api-2016.1.1374211
	API Release 2016.1
   
Installing collected packages: p4python
  Running setup.py install for p4python
	*******************************************
	** Building P4Python without SSL support **
	*******************************************
	Attempting to load API from ftp.perforce.com
	Loaded API into /tmp/p4api-2016.1.1374211
	API Release 2016.1
	building 'P4API' extension
	x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DID_OS="LINUX31X86_64" -DID_REL="2015.2" -DID_PATCH="1348262" -DID_API="2016.1/1374211" -DID_Y="2015" -DID_M="02" -DID_D="09" -I/tmp/p4api-2016.1.1374211 -I/tmp/p4api-2016.1.1374211/include/p4 -I/usr/include/python2.7 -c P4API.cpp -o build/temp.linux-x86_64-2.7/P4API.o -DOS_LINUX -DOS_LINUX31 -DOS_LINUXX86_64 -DOS_LINUX31X86_64
	cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
	P4API.cpp:39:20: fatal error: Python.h: 没有那个文件或目录
	 #include <Python.h>
						^
	compilation terminated.
	error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
	Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_ontim/p4python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-sbqbH0-record/install-record.txt --single-version-externally-managed --compile:
	*******************************************[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]** Building P4Python without SSL support **[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]*******************************************[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]Attempting to load API from ftp.perforce.com[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]Loaded API into /tmp/p4api-2016.1.1374211[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]API Release 2016.1[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]running install[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]running build[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]running build_py[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]creating build[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]creating build/lib.linux-x86_64-2.7[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]copying P4.py -> build/lib.linux-x86_64-2.7[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]running build_ext[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]building 'P4API' extension[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]creating build/temp.linux-x86_64-2.7[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DID_OS="LINUX31X86_64" -DID_REL="2015.2" -DID_PATCH="1348262" -DID_API="2016.1/1374211" -DID_Y="2015" -DID_M="02" -DID_D="09" -I/tmp/p4api-2016.1.1374211 -I/tmp/p4api-2016.1.1374211/include/p4 -I/usr/include/python2.7 -c P4API.cpp -o build/temp.linux-x86_64-2.7/P4API.o -DOS_LINUX -DOS_LINUX31 -DOS_LINUXX86_64 -DOS_LINUX31X86_64[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]P4API.cpp:39:20: fatal error: Python.h: 没有那个文件或目录[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]#include <Python.h>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]					^[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]compilation terminated.[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]error: command 'x86_64-linux-gnu-gcc' failed with exit status 1[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_ontim/p4python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-sbqbH0-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_ontim/p4python
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
	load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
	return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
	text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)
  

can you tell me why?

#2 szymonlyszkowski

szymonlyszkowski

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 28 December 2016 - 11:09 AM

This error occurred again:
sudo pip3 install p4python==2016.1.1447008
The directory '/home/lyszkows/.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/lyszkows/.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 p4python==2016.1.1447008
  The repository located at artifactory-ci.tomtomgroup.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host artifactory-ci.tomtomgroup.com'.
  Downloading p4python-2016.1.1447008.tar.gz (84kB)
	100% |████████████████████████████████| 92kB 1.6MB/s
	Complete output from command python setup.py egg_info:
	Attempting to load API from ftp.perforce.com
	Traceback (most recent call last):
	  File "<string>", line 1, in <module>
	  File "/tmp/pip-build-ngk7tqea/p4python/setup.py", line 611, in <module>
		p4_api_dir = get_api_dir()
	  File "/tmp/pip-build-ngk7tqea/p4python/setup.py", line 533, in get_api_dir
		p4_api_dir = p4ftp.loadAPI()
	  File "/tmp/pip-build-ngk7tqea/p4python/setup.py", line 193, in loadAPI
		self.ftp.retrlines("LIST", lambda str : dirs.append(str))
	  File "/usr/lib/python3.5/ftplib.py", line 467, in retrlines
		with self.transfercmd(cmd) as conn, \
	  File "/usr/lib/python3.5/ftplib.py", line 398, in transfercmd
		return self.ntransfercmd(cmd, rest)[0]
	  File "/usr/lib/python3.5/ftplib.py", line 360, in ntransfercmd
		source_address=self.source_address)
	  File "/usr/lib/python3.5/socket.py", line 711, in create_connection
		raise err
	  File "/usr/lib/python3.5/socket.py", line 702, in create_connection
		sock.connect(sa)
	TimeoutError: [Errno 110] Connection timed out
can you check whether ftp.perforce.com is storing all artifacts correctly?





Also tagged with one or more of these keywords: p4python, error, commands, API

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users