#StackBounty: #python #amazon-ec2 #pip #amazon #setuptools Why does `pip` throw `ModuleNotFoundError` even though `setuptools` appears …

Bounty: 50

On an EC2 instance, I am attempting to install a Python package using pip, but receive an exception that states ModuleNotFoundError: No module named 'setuptools'.

For context, the command I run is

pip install --user mlflow

I attempt to resolve the issue my installing setuptools with the following command: sudo yum install python36-setuptools. Yet, the message returned indicates that setuptools is already installed:

Package python36-setuptools-36.2.7-1.33.amzn1.noarch already installed and latest version
Nothing to do

Please advise.

UPDATE: After switching the EC2 instance from Amazon Linux AMI 2018.03.0 to Amazon Linux 2 AMI I was able to successfully install mlflow using pip.

The question still remains – why was I able to successfully install using Amazon Linux 2 AMI but not Amazon Linux AMI 2018.03.0?


Get this bounty!!!

#StackBounty: #python #cmake #setuptools setuptools "eager_resources" to executable directory

Bounty: 300

I maintain a Python utility that allows bpy to be installable as a Python module.

Unfortunately, platform differences and Blender runtime expectations makes support for this tricky at times.

Currently, one of my big goals is to get the Blender addon scripts directory to install into the correct location. The directory (simply named after the version of Blender API) has to exist in the same directory as the Python executable.

Unfortunately the way that setuptools works (or at least the way that I have it configured) the 2.79 directory is not always placed as a sibling to the Python executable. It fails on Windows platforms outside of virtual environments.

However, I noticed in setuptools documentation that you can specify eager_resources that supposedly guarantees the location of extracted files.

https://setuptools.readthedocs.io/en/latest/setuptools.html#automatic-resource-extraction
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#resource-extraction

There was a lot of hand waving and jargon in the documentation, and 0 examples. I’m really confused as to how to structure my setup.py file in order to guarantee the resource extraction. Currently, I just label the whole 2.79 directory as “scripts” in my setuptools Extension and ship it.

Is there a way to write my setup.py and package my module so as to guarantee the 2.79 directory’s location is the same as the currently running python executable when someone runs

py -3.6.8-32 -m pip install bpy

Besides simply “hacking it in”? I was considering writing a install_requires module that would simply move it if possible but that is mangling with the user’s file system and kind of hacky. However it’s the route I am going to go if this proves impossible.

Here is the original issue for anyone interested.

https://github.com/TylerGubala/blenderpy/issues/13

My build process is identical to the process descsribed in my answer here

https://stackoverflow.com/a/51575996/6767685


Get this bounty!!!