from packaging import version as pack_version ImportError: No module named packaging

David Gabriel davidgab283 at gmail.com
Sat Oct 28 08:33:00 EDT 2017


I forget to precise that I am using pycharm.
And this issue is reproducible also using command line to run the code.

Best regards

2017-10-28 14:31 GMT+02:00 David Gabriel <davidgab283 at gmail.com>:

> Thanks so Lutz much for your reply.
> I am using python2.7 and I am running this code in an Openstack instance.
> I will apply your recommandation and let you know about the result ...
>
> Kind regards.
>
> 2017-10-27 16:13 GMT+02:00 Lutz Horn <lutz.horn at posteo.de>:
>
>> On Fri, Oct 27, 2017 at 03:56:39PM +0200, David Gabriel wrote:
>> > from packaging import version as pack_version
>> > ImportError: No module named packaging
>> >
>> > I googled it and I have found so many suggestions regarding updating
>> > 'pip' and installing python-setuptools but all of these did not fix
>> > this issue.
>>
>> So many questions:
>>
>> * What is your Python version?
>> * Do you use virtualenv?
>> * How?
>> * Did you install packaging in this virtualenv?
>>
>> Just one example of making this work:
>>
>> $ mkdir /tmp/pack
>> $ cd /tmp/pack
>> $ virtualenv -p $(which python3.5) .
>> Running virtualenv with interpreter /usr/bin/python3.5
>> Using base prefix '/usr'
>> New python executable in /tmp/pack/bin/python3.5
>> Also creating executable in /tmp/pack/bin/python
>> Installing setuptools, pkg_resources, pip, wheel...done.
>> $ source bin/activate
>> $ pip3 install packaging
>> Collecting packaging
>>   Using cached packaging-16.8-py2.py3-none-any.whl
>> Collecting six (from packaging)
>>   Using cached six-1.11.0-py2.py3-none-any.whl
>> Collecting pyparsing (from packaging)
>>   Using cached pyparsing-2.2.0-py2.py3-none-any.whl
>> Installing collected packages: six, pyparsing, packaging
>> Successfully installed packaging-16.8 pyparsing-2.2.0 six-1.11.0
>> $ python3.5
>> Python 3.5.2 (default, Sep 14 2017, 22:51:06)
>> [GCC 5.4.0 20160609] on linux
>> Type "help", "copyright", "credits" or "license" for more
>> information.
>> >>> from packaging import version as pack_version
>> >>>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>



More information about the Python-list mailing list