- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一个完全隔离的 boostrapped 工具链 + 二进制文件设置(位于/home/tools 下),它能够构建我扔给它的所有东西。其中包括 Python 2.7.14,它使用简单的 --prefix 构建而没有问题。 唯一的异常(exception)是 Python 3.6.4。我不得不编辑 configure 和 setup.py 脚本来修补一些设置为标准/usr 目录的硬编码路径(ncursesw 的链接很明显)。它完全正确地编译和构建,除了在 pip 的“make install”安装过程中失败。安装脚本在/tmp 下创建了一个 pip-build-* 目录,失败的根源似乎是围绕着它。它出现在目录首次创建时,它是使用适当的权限掩码创建的。但是在失败之后,我可以看到它只是用户可写的(甚至不可读或可执行)。
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
这里是 strace 的结尾,显示了出错的位置。
[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
这是“make install”过程的 stdout/stderr 输出。它来自另一次运行,因此目录略有不同。
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 目录中,但安装后续包(如介子)以类似的方式失败,所以我假设 Python 3.6/pip 安装没有完全成功。好像也来自shutil.py。这是介子安装的strace。
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 书中的大部分内容。它运行的是带有内核 2.6.18 的旧 Red Hat/CentOS 5 发行版,由于支持旧版 CAD 软件而无法更新。但是我现在有一个完整的工作环境,它有内核 (2.19)、GCC (7.3.0)、binutils (2.30) 等支持的最新 Glibc。我已经得到了正确构建的所有东西,甚至 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
最佳答案
我已经安装了一长串 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
关于Python 3.6 无法安装到 Linux 下的非标准目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49074327/
我正在为我的程序编写安装脚本,它应该在 Linux/Unix 操作系统上运行。以下文件的默认目录是什么: 可执行文件(程序)。程序应通过从命令行键入其名称来执行。 共享库。 第三方共享库(程序未开源,
我有一堆用户、组和应用程序注册,我的 MVC 应用程序使用 AAD 数据进行身份验证和授权。是否可以将 Azure Active Directory 从一个租户(目录)迁移到另一个租户(目录)?如果可
查看 cljsbuild 文档 https://github.com/emezeske/lein-cljsbuild :cljsbuild { :builds [{ ; The
忽略已经版本控制的文件 如果你不小心添加了一些应该被忽略的文件,你如何将它们从版本控制中去除而不会丢失它们?或许你有自己的IDE配置文件,不是项目的一部分,但将会花费很多时间使之按照自己的方式工作。
我想使用\tableofcontents 命令,但没有目录从新页面开始或在末尾创建新页面,并且所有内容都是单倍行距。我怎样才能做到这一点?我假设使用 tocloft,但有哪些选择? 谢谢 最佳答案 试
我有一些 javascript 菜单代码,可以在单独的目录中正常工作。但是,当我尝试从同一目录中调用相同的 .js 文件时,它不会看到这些文件。 以下内容来自另一个目录: script type="t
我有这样的路径: /my/path/to/important_folder 在同一级别上,我还有其他文件和文件夹想要在达到与 important_folder 相同的级别时列出。 我的文件夹可能更深,
1、获取文件路径实现 1.1 获取当前文件路径 ? 1
我正在使用最新版本的 NTEmacs。 我写了一个名为“.dir-locals.el”的文件,如下所示。 ((nil . ((tab-width . 8) (fill-column .
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
在我的 .vimrc 中有这些行 :set foldmethod=marker :set foldmarker=SECTION:,ENDSECTION: 用于自定义代码折叠。在我的文件中,相关语言的注
在 fish 中: for x in * echo $x end *这里包括所有目录和文件,如何只列出文件(或目录)? 最佳答案 fish 没有很多花哨的通配语法。但是,目录可以像这样迭代: f
这是我的目录结构: ├── src │ ├── helpers │ │ ├── __init__.py │ │ ├── foo.py │ │ └── bar.py │
我想递归重命名文件夹/目录名称并找到 this solution所以。但是这个命令没有效果 find . -type f -exec rename 's/old/new/' '{}' \; 这是一个正
我想在相册中创建一个文件夹,并希望将图像保存在创建的相册中。 这可能吗?有什么办法可以做到这一点吗? 我已经搜索过,大多数人都说这是不可能的。 感谢您的帮助。 最佳答案 您也许可以使用AssetsLi
如何在python中使用用户定义的名称创建临时文件/目录。我知道 tempfile .但是我看不到任何以文件名作为参数的函数。 注意:我需要这个来对包含临时文件的临时目录上的 glob(文件名模式匹配
我在项目中使用JaCoCo Gradle插件。 作为问题的一个示例,我的大部分代码都在com.me.mysoftware包下。 我正在使用代码生成器来生成build/generated/java/..
我正在尝试使用 Gradle 开始运行 jar 文件 我的任务如下所示: task startServer(type: Exec) { workingDir file("${buildDir}/a
如何在 Ant 中定义一个目录集,其中包括两个目录:项目的基目录和子目录“test”? 看起来您无法使用“/”、“.”或“”专门包含目录集的根目录。例如,这包括“./test”,但不包括“.”:
我正在使用 CTAGs 包,它使用 Sublime Text 2 生成两个文件 .tags 和 .tags_sorted_by_file。 那么当我进行项目搜索(CMD + SHIFT + F)时,如
我是一名优秀的程序员,十分优秀!