我尝试使用以下方法安装dlib:
pip install dlib
它似乎正在工作,但后来我收到了一条错误消息。这是:
Collecting dlib
Using cached dlib-19.7.0.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... done
Stored in directory: /home/andrew/.cache/pip/wheels/17/1f/5d/187f5a9fc1d63527e97fa08f5f43315e72a7b7c2ebc54e02e3
Successfully built dlib
Installing collected packages: dlib
Exception:
Traceback (most recent call last):
File "/home/andrew/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/andrew/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/andrew/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/andrew/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/andrew/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/andrew/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/andrew/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/home/andrew/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/dlib'
我遵循了之前的所有步骤,我只是不确定为什么它会拒绝许可。有谁知道如何解决这个错误?