Ich habe in den letzten Monaten an einem Programm gearbeitet, das python 3 verwendet. Ich teste es schon seit einiger Zeit und es scheint zu funktionieren wie es sollte. Also habe ich versucht, es mit einer DSM/Synology (Modell: DS209 +, Version: DSM 4.2-3259) zu starten. Leider weiß ich nichts über diese Umgebung. Also ich python3 (3.3.2-0005) aus dem Synology Paketzentrum installiert und es funktioniert. Das Ausführen meines Codes funktioniert. Das einzige Problem ist, dass mein Programm die Bibliothek "Anfragen" verwendet. Aber ich kann einfach nicht laufen. Zur Installation von pip habe ich versucht, die folgende Zeile in PuTTY zu verwenden.Installieren von Pip auf einer DSM/Synology
curl -k https://bootstrap.pypa.io/get-pip.py | python3
Ich würde erwarten, dass pip herunterladen/installieren und es verwenden, um die Bibliothek Anfragen zu erhalten. Aber dann geschieht dies, und ich habe nicht wissen, was ich falsch gemacht habe:
The directory '/var/services/homes/admin/.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 '/var/services/homes/admin/.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 pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 131kB/s
Collecting setuptools
Downloading setuptools-38.2.4-py2.py3-none-any.whl (489kB)
100% |################################| 491kB 305kB/s
Collecting wheel
Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
100% |################################| 51kB 296kB/s
Installing collected packages: pip, setuptools, wheel
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.3/distutils/sysconfig.py", line 449, in _init_posix
with open(filename) as file:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/include/python3.3m/pyconfig.h'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/tmpdqp31o/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/tmp/tmpdqp31o/pip.zip/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/tmp/tmpdqp31o/pip.zip/pip/req/req_set.py", line 784, in install
**kwargs
File "/tmp/tmpdqp31o/pip.zip/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/tmp/tmpdqp31o/pip.zip/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/tmp/tmpdqp31o/pip.zip/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/tmp/tmpdqp31o/pip.zip/pip/locations.py", line 153, in distutils_scheme
i.finalize_options()
File "/usr/local/lib/python3.3/distutils/command/install.py", line 313, in finalize_options
(prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
File "/usr/local/lib/python3.3/distutils/sysconfig.py", line 531, in get_config_vars
func()
File "/usr/local/lib/python3.3/distutils/sysconfig.py", line 456, in _init_posix
raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/local/include/python3.3m/pyconfig.h (No such file or directory)
Es scheint wie sudo -H mit dem Problem würde beheben. Ich habe jedoch keine Ahnung, wie ich das machen soll und wo ich anfangen soll. Googeln das Problem hat auch nicht viel geholfen, weil die Dinge, die ich gefunden habe entweder zu vage für mich zu verstehen oder sie hatten dieses Problem mit Pip bereits installiert. Ich hoffe, diese Frage ist auch nicht zu vage.
So Ihr Problem ist, Sie wissen nicht, Wie kann ich in die Sudo-Sitzung wechseln? Melden Sie sich als Administrator an, geben Sie im PuTTY-Terminal "sudo -i" ein, geben Sie das Administratorkennwort ein und wiederholen Sie den Installationsbefehl. – hoefling