pip3 install issues. Missing distutils???

27 views
Skip to first unread message

Benjam901

unread,
Mar 5, 2019, 3:41:35 AM3/5/19
to Python Programming for Autodesk Maya
Hello all,

Long time no post. I am working on a small home project and have a Macbook to go with it now instead of a PC. 

NOTE:
Now this issue I realised this morning can be avoided if I just straight git clone my repo into my viertual env but I would like to know why this happens in case I do put the library on PyPI one day.

ISSUE:
I installed Python3 via homebrew as 2.7 becomes deprecated at the end of this year I thought I might as well make the shift over. (Is it necessary to run on Python3 or is sticking with 2.7 ok? Am just wondering)

So I went into Pycharm and set myself up a new project with a venv and tried to run the following:

pip3 install git+https://github.com/ben-hearn-sb/collection_cleanup.git#egg=collection_cleanup

Instead of an src folder being created and my git repo being cloned to it, I get the following error instead:

  Cloning https://github.com/ben-hearn-sb/collection_cleanup.git to /private/var/folders/wq/h99zwqzd067fmnyqktf9q0dh0000gn/T/pip-install-uwdlmrmv/collection-cleanup
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/collection_cleanup.egg-info
    writing pip-egg-info/collection_cleanup.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/collection_cleanup.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/collection_cleanup.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/collection_cleanup.egg-info/SOURCES.txt'
    error: package directory 'distutils' does not exist
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/wq/h99zwqzd067fmnyqktf9q0dh0000gn/T/pip-install-uwdlmrmv/collection-cleanup/

I was looking around online for the solution to why distutils is missing this but could not find it at all. Does anyone know what might be happening?

Cheers,

Ben

Stefan Tapper

unread,
Mar 5, 2019, 4:52:52 AM3/5/19
to Python Programming for Autodesk Maya
Hey, I've had similar issues(but when building an app with PyInstaller). Virtualenv 16.4 outputs a different path to distutils than previous versions. Running with virtualenv 16.2.0 here works fine. Maybe try to install 16.2 on your system interpreter: python3 -m pip virtualenv=16.2.0

Stefan Tapper

unread,
Mar 5, 2019, 4:55:45 AM3/5/19
to Python Programming for Autodesk Maya
Btw, do not forget to re-create the virtual env afterwards.. pipenv is a nice method to do that and is also supported by PyCharm

Justin Israel

unread,
Mar 5, 2019, 6:07:52 AM3/5/19
to python_in...@googlegroups.com


On Tue, Mar 5, 2019, 9:41 PM Benjam901 <benandr...@gmail.com> wrote:
(Is it necessary to run on Python3 or is sticking with 2.7 ok? Am just wondering)

Seeing as this is a Maya forum, my answer is going to be specific to Maya (and related to visual effects somewhat, since that is my area). 
While Python3 is the modern standard and Py2 is EOL as of 2020, if you are targeting integration with any current release of common vfx DCCs like Maya, Nuke, Houdini, etc, then you are still targeting python 2.7. At some point one of them is going to commit to an embedded python3 environment. So your best bet for now is to code in a py2/3 compatible way via python-future (or six library) so that your code works now in py2 and will be ready immediately for py3 


So I went into Pycharm and set myself up a new project with a venv and tried to run the following:

pip3 install git+https://github.com/ben-hearn-sb/collection_cleanup.git#egg=collection_cleanup

Instead of an src folder being created and my git repo being cloned to it, I get the following error instead:

  Cloning https://github.com/ben-hearn-sb/collection_cleanup.git to /private/var/folders/wq/h99zwqzd067fmnyqktf9q0dh0000gn/T/pip-install-uwdlmrmv/collection-cleanup
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/collection_cleanup.egg-info
    writing pip-egg-info/collection_cleanup.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/collection_cleanup.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/collection_cleanup.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/collection_cleanup.egg-info/SOURCES.txt'
    error: package directory 'distutils' does not exist
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/wq/h99zwqzd067fmnyqktf9q0dh0000gn/T/pip-install-uwdlmrmv/collection-cleanup/

I was looking around online for the solution to why distutils is missing this but could not find it at all. Does anyone know what might be happening?

Cheers,

Ben

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/533459b6-de85-4e14-8c50-1b6996cf4218%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages