I am trying to make a deployment package with additional dependencies as per this guide https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html
I am doing this as a test, to see how simple it is. So i decided to try and import the first package that popped into my mind which was tldextract.
The guide tells me to make a fir called package, go into that package and then type "pip3 install tldextract --target ."
However, I get an error message: distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base
I have searched through this: Combine --user with --prefix error with setup.py install But to no avail.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 360, in run
prefix=options.prefix_path,
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/usr/lib/python3/dist-packages/pip/locations.py", line 153, in distutils_scheme
i.finalize_options()
File "/usr/lib/python3.6/distutils/command/install.py", line 274, in finalize_options
raise DistutilsOptionError("can't combine user with prefix, "
distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base```
You may have moved passed this, but just in case it helps (this drove me up a wall for the last half hour):
I'm running Debian and was trying to install pymysql
, but try issuing the command with sudo:
sudo pip3 install tldextract --target .
I don't know why this worked yet, but will update with more info if I come across any. Files were installed in my local directory owned by root, which is unfortunate, but chown
fixed that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With