Python 3.6 не удается установить в нестандартный каталог в Linux
У меня есть полностью изолированный набор инструментов с расширенным набором инструментов + установка двоичных файлов (расположенный в /home/tools), который смог собрать все, что я на него брошу. Это включает в себя Python 2.7.14, который собран без проблем с простым префиксом. Единственным исключением является Python 3.6.4. Мне пришлось отредактировать скрипт configure и setup.py, чтобы исправить некоторые из жестко закодированных путей, которые были установлены в стандартные каталоги / usr (ссылка на ncursesw была заметна). Он полностью скомпилирован и скомпилирован правильно, за исключением случаев, когда во время установки pip "make install". Сценарии установки создают каталог pip-build-* в /tmp, и источник ошибки, кажется, сосредоточен вокруг этого. Появляется при первом создании каталога с соответствующей маской разрешения. Но после сбоя я вижу, что он доступен только для записи пользователю (даже не для чтения и не для выполнения).
d-w------- 4 myuser eng 4096 Mar 1 00:56 pip-build-xh7onsny/
Вот раздел strace, где он сначала создает каталог pip-build-*.
[pid 19771] lstat("/home/myuser/.cache/pip", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
[pid 19771] geteuid() = 10345
[pid 19771] access("/home/myuser/.cache/pip", W_OK) = 0
[pid 19771] mkdir("/tmp/pip-build-xh7onsny", 0700) = 0
[pid 19771] lstat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=28672, ...}) = 0
[pid 19771] lstat("/tmp/pip-build-xh7onsny", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
[pid 19771] getcwd("/nfs/home/myuser/lfs/sources/Python-3.6.4"..., 1024) = 46
Вот конец строки, который показывает, где она вышла из Error.
[pid 19771] munmap(0x2ac5506c0000, 4096) = 0
[pid 19771] stat("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", {st_mode=S_IFREG|0644, st_size=40227, ...}) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=40227, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a58460) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "\"\"\"Utility functions for copying"..., 32768) = 32768
[pid 19771] lseek(4, 0, SEEK_CUR) = 32768
[pid 19771] read(4, "e, extract_dir=None, format=None"..., 8192) = 7459
[pid 19771] read(4, "", 8192) = 0
[pid 19771] close(4) = 0
[pid 19771] ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a59f40) = -1 EINVAL (Invalid argument)
[pid 19771] write(2, "Exception:\nTraceback (most recen"..., 1739Exception:
Traceback (most recent call last):
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 385, in run
requirement_set.cleanup_files()
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/utils/build.py", line 38, in __exit__
self.cleanup()
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/utils/build.py", line 42, in cleanup
rmtree(self.name)
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/retrying.py", line 212, in call
raise attempt.get()
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/six.py", line 686, in reraise
raise value
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "/tmp/tmpojuc47gy/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 102, in rmtree
onerror=rmtree_errorhandler)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 476, in rmtree
onerror(os.lstat, path, sys.exc_info())
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 474, in rmtree
fd = os.open(path, os.O_RDONLY)
PermissionError: [Errno 13] Permission denied: '/tmp/pip-build-xh7onsny'
) = 1739
[pid 19771] lstat("/tmp/tmpojuc47gy", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
[pid 19771] open("/tmp/tmpojuc47gy", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/runpy.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=11959, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "\"\"\"runpy.py - locating and runni"..., 8192) = 8192
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/runpy.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=11959, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "\"\"\"runpy.py - locating and runni"..., 8192) = 8192
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__main__.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=88, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "import ensurepip\nimport sys\n\nif "..., 8192) = 88
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__init__.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=6391, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "import os\nimport os.path\nimport "..., 8192) = 6391
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__init__.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=6391, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "import os\nimport os.path\nimport "..., 8192) = 6391
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/tempfile.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=26635, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "\"\"\"Temporary files.\n\nThis module"..., 8192) = 8192
[pid 19771] read(4, " continue # try again\n "..., 8192) = 8192
[pid 19771] read(4, "\n \"\"\"\n Close the t"..., 8192) = 8192
[pid 19771] read(4, "emporaryFileArgs['mode']:\n "..., 8192) = 2059
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/tempfile.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=26635, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "\"\"\"Temporary files.\n\nThis module"..., 8192) = 8192
[pid 19771] read(4, " continue # try again\n "..., 8192) = 8192
[pid 19771] read(4, "\n \"\"\"\n Close the t"..., 8192) = 8192
[pid 19771] read(4, "emporaryFileArgs['mode']:\n "..., 8192) = 2059
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=40227, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "\"\"\"Utility functions for copying"..., 8192) = 8192
[pid 19771] read(4, " that are used to exclude fil"..., 8192) = 8192
[pid 19771] read(4, " = os.open(path, os.O_RDONLY)\n "..., 8192) = 8192
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=40227, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "\"\"\"Utility functions for copying"..., 8192) = 8192
[pid 19771] read(4, " that are used to exclude fil"..., 8192) = 8192
[pid 19771] close(4) = 0
[pid 19771] open("/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", O_RDONLY|0x80000 /* O_??? */) = 4
[pid 19771] ioctl(4, FIOCLEX) = 0
[pid 19771] fstat(4, {st_mode=S_IFREG|0644, st_size=40227, ...}) = 0
[pid 19771] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff38a5b0d0) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] fcntl(4, 0x406 /* F_??? */, 0) = -1 EINVAL (Invalid argument)
[pid 19771] lseek(4, 0, SEEK_SET) = 0
[pid 19771] lseek(4, 0, SEEK_CUR) = 0
[pid 19771] read(4, "\"\"\"Utility functions for copying"..., 8192) = 8192
[pid 19771] read(4, " that are used to exclude fil"..., 8192) = 8192
[pid 19771] close(4) = 0
[pid 19771] write(2, "Traceback (most recent call last"..., 1425Traceback (most recent call last):
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/tempfile.py", line 807, in __exit__
self.cleanup()
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/tempfile.py", line 811, in cleanup
_shutil.rmtree(self.name)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 480, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 402, in _rmtree_safe_fd
onerror(os.listdir, path, sys.exc_info())
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 399, in _rmtree_safe_fd
names = os.listdir(topfd)
OSError: [Errno 22] Invalid argument: '/tmp/tmpojuc47gy'
) = 1425
[pid 19771] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x2ac548950ab0}, {0x2ac5485f8ca0, [], SA_RESTORER, 0x2ac548950ab0}, 8) = 0
[pid 19771] munmap(0x2ac54c1df000, 1257472) = 0
[pid 19771] munmap(0x2ac54f203000, 262144) = 0
[pid 19771] sigaltstack(NULL, {ss_sp=0xc877ce0, ss_flags=0, ss_size=8192}) = 0
[pid 19771] sigaltstack({ss_sp=0, ss_flags=SS_DISABLE, ss_size=0}, NULL) = 0
[pid 19771] close(3) = 0
[pid 19771] futex(0x2ac54b6f78ac, FUTEX_WAKE_PRIVATE, 2147483647) = 0
[pid 19771] exit_group(1) = ?
Process 19770 resumed
Process 19771 detached
[pid 19770] <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 19771
[pid 19770] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 19770] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid 19770] wait4(-1, 0x7fff47da9a04, WNOHANG, NULL) = -1 ECHILD (No child processes)
[pid 19770] rt_sigreturn(0xffffffffffffffff) = 0
[pid 19770] rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x3c31a30030}, {0x436f50, [], SA_RESTORER, 0x3c31a30030}, 8) = 0
[pid 19770] exit_group(1) = ?
Process 16346 resumed
Process 19770 detached
[pid 16346] <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 19770
[pid 16346] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid 16346] rt_sigreturn(0xffffffff) = 19770
[pid 16346] write(2, "make: *** [Makefile:1099: instal"..., 43make: *** [Makefile:1099: install] Error 1
) = 43
Вот вывод stdout / stderr из процесса 'make install'. Это было из другого прогона, поэтому каталоги немного другие.
Installing collected packages: setuptools, pip
Successfully installed pip-9.0.1 setuptools-28.8.0
Exception:
Traceback (most recent call last):
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 385, in run
requirement_set.cleanup_files()
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/utils/build.py", line 38, in __exit__
self.cleanup()
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/utils/build.py", line 42, in cleanup
rmtree(self.name)
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/retrying.py", line 212, in call
raise attempt.get()
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/six.py", line 686, in reraise
raise value
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "/tmp/tmpkmstr4wc/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 102, in rmtree
onerror=rmtree_errorhandler)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 476, in rmtree
onerror(os.lstat, path, sys.exc_info())
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 474, in rmtree
fd = os.open(path, os.O_RDONLY)
PermissionError: [Errno 13] Permission denied: '/tmp/pip-build-in_asosn'
Traceback (most recent call last):
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/tempfile.py", line 807, in __exit__
self.cleanup()
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/tempfile.py", line 811, in cleanup
_shutil.rmtree(self.name)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 480, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 402, in _rmtree_safe_fd
onerror(os.listdir, path, sys.exc_info())
File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 399, in _rmtree_safe_fd
names = os.listdir(topfd)
OSError: [Errno 22] Invalid argument: '/tmp/tmpkmstr4wc'
make: *** [Makefile:1109: altinstall] Error 1
Стоит отметить, что он на самом деле устанавливает двоичные файлы pip в мой каталог $prefix/bin, но установка последующих пакетов, таких как meson, не удалась аналогичным образом, поэтому я предполагаю, что установка Python 3.6 / pip не прошла полностью. Кажется, также происходит от shutil.py. Вот полоска для установки мезонов.
write(2, "Traceback (most recent call last"..., 1805Traceback (most recent call last):
File "/home/tools/lib/python3.6/shutil.py", line 399, in _rmtree_safe_fd
names = os.listdir(topfd)
OSError: [Errno 22] Invalid argument: '/tmp/easy_install-0o0par1r'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 98, in <module>
complete DSL.''')
File "/home/tools/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/tools/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/tools/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/tools/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/tools/lib/python3.6/site-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run()
File "/home/tools/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 410, in run
self.easy_install(spec, not self.no_deps)
File "/home/tools/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 669, in easy_instal
l
rmtree(tmpdir)
File "/home/tools/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 2227, in rmtree
return shutil.rmtree(path, ignore_errors, onerror)
File "/home/tools/lib/python3.6/shutil.py", line 480, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/home/tools/lib/python3.6/shutil.py", line 402, in _rmtree_safe_fd
onerror(os.listdir, path, sys.exc_info())
File "/home/tools/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1677, in auto_chmod
six.reraise(et, (ev[0], ev[1] + (" %s %s" % (func, arg))))
TypeError: 'OSError' object is not subscriptable
) = 1805
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x2b2b4caa4ab0}, {0x2b2b4c74cca0, [], SA_RESTORER, 0x2b2b4caa
4ab0}, 8) = 0
Я попытался изменить каталог /tmp в своем собственном домашнем каталоге, и возникает та же ошибка, которая также имеет разрешения на нечетную запись только для каталога pip-build-*. Я был бы признателен за любую помощь в устранении этой проблемы и получении Python 3.6.4 для правильной установки. Спасибо!
Предыстория: я установил отдельный загруженный набор инструментов и двоичные файлы, которые полностью изолированы от библиотек хоста на сервере Linux на работе, следуя большей части книги Linux From Scratch. Он использует старый дистрибутив Red Hat / CentOS 5 с ядром 2.6.18, который не может быть обновлен из-за поддержки более старого программного обеспечения САПР. Но теперь у меня есть полностью рабочая среда, в которой установлены последние версии Glibc, поддерживаемые ядром (2.19), GCC (7.3.0), binutils (2.30) и т. Д. Я получил все, что мне бросили, для правильной сборки, даже библиотеки X и приложения gtk, все напрямую ссылаются на мой набор библиотек через rpath.
Вот моя конфигурация, мне нужно установить ac_cv_func_utimensat=no и ac_cv_func_futimens=no, потому что, вероятно, файловая система или ядро в моей системе не поддерживает наносекундные метки времени. С этими параметрами и установкой файлов configure / setup.py для удаления ссылок на / usr / lib / ncursesw и замены на мой путь / home / tools / lib все строится просто отлично. Во время фазы pip 'make install' происходит сбой.
./configure --prefix=/home/tools \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--with-ensurepip=install \
ac_cv_func_utimensat=no \
ac_cv_func_futimens=no
1 ответ
Я установил длинный список версий Python, включая 3.6.4 в ~/.local. Никогда не было проблем с --prefix
, Это скрипт, который я использую для (пере) компиляции и установки:
#! /bin/sh
prefix="$HOME"/.local
[ -f Makefile ] && make distclean
OPT="-DNDEBUG=1 -O3" LDFLAGS="-L$prefix/lib -Xlinker -R$prefix/lib" \
LD_LIBRARY_PATH="`pwd`:$prefix/lib" \
CC="${CC:-gcc}" CPPFLAGS="-DNDEBUG=1 $CPPFLAGS" CFLAGS="-O3 $CFLAGS" \
CXX="${CXX:-g++}" CXXFLAGS="-O3 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" \
./configure --enable-shared --prefix="$prefix" &&
make &&
chmod -R a+rX build &&
exec make install