problem with pkg_resources in python 3

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem with pkg_resources in python 3

Kurt Pfeifle via macports-users
Hello,

I have Macports python 3.5 and 3.6 and I have installed setuptools and pip for each version, on Mac OS 10.12.5, XCode 8.3.3
However for python3.5 it says it does not find pkg_resources and for python3.6, it is even worse, python crashes :

laurent>python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'pkg_resources'

laurent>python3.6
Python 3.6.1 (default, Apr 24 2017, 06:18:27)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
Python(85816,0x7fffcc2cc3c0) malloc: *** error for object 0x1091fa318: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort

Any hint ?
Thanks,
lpagani

"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème" (devise Shadok)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Joshua Root-8
> I have Macports python 3.5 and 3.6 and I have installed setuptools and pip for each version, on Mac OS 10.12.5, XCode 8.3.3
> However for python3.5 it says it does not find pkg_resources and for python3.6, it is even worse, python crashes :
>
> laurent>python3.5
> Python 3.5.2 (default, Dec 17 2016, 06:22:37)
> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import pkg_resources
>>>> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named 'pkg_resources'
>
> laurent>python3.6
> Python 3.6.1 (default, Apr 24 2017, 06:18:27)
> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import pkg_resources
> Python(85816,0x7fffcc2cc3c0) malloc: *** error for object 0x1091fa318: pointer being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
> Abort
>
> Any hint ?

Please show the output of this command:

port installed 'python*' '*setuptools' '*pip'

There is at least one thing wrong with this picture, as the version of
python35 currently in MacPorts is 3.5.3. So either there is a different
python3.5 earlier in your PATH, or you need to update.

- Josh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Kurt Pfeifle via macports-users
The following ports are currently installed:
  py27-pip @9.0.1_0 (active)
  py27-setuptools @36.0.1_0 (active)
  py35-pip @9.0.1_0 (active)
  py35-setuptools @36.0.1_0 (active)
  py36-pip @9.0.1_0 (active)
  py36-setuptools @36.0.1_0 (active)
  python2_select @0.0_2 (active)
  python3_select @0.0_1 (active)
  python27 @2.7.13_1 (active)
  python34 @3.4.6_1 (active)
  python35 @3.5.3_1 (active)
  python36 @3.6.1_1 (active)
  python_select @0.3_7 (active)

I have just uninstalled all inactive versions of all ports but when I start python3.5 it still says it is running python3.5.2

Laurent

> Le 12 juil. 2017 à 15:43, Joshua Root <[hidden email]> a écrit :
>
>> I have Macports python 3.5 and 3.6 and I have installed setuptools and pip for each version, on Mac OS 10.12.5, XCode 8.3.3
>> However for python3.5 it says it does not find pkg_resources and for python3.6, it is even worse, python crashes :
>> laurent>python3.5
>> Python 3.5.2 (default, Dec 17 2016, 06:22:37) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import pkg_resources
>>>>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>> ImportError: No module named 'pkg_resources'
>> laurent>python3.6
>> Python 3.6.1 (default, Apr 24 2017, 06:18:27) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import pkg_resources
>> Python(85816,0x7fffcc2cc3c0) malloc: *** error for object 0x1091fa318: pointer being freed was not allocated
>> *** set a breakpoint in malloc_error_break to debug
>> Abort
>> Any hint ?
>
> Please show the output of this command:
>
> port installed 'python*' '*setuptools' '*pip'
>
> There is at least one thing wrong with this picture, as the version of python35 currently in MacPorts is 3.5.3. So either there is a different python3.5 earlier in your PATH, or you need to update.
>
> - Josh

"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème" (devise Shadok)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Joshua Root-8
On 2017-7-13 00:15 , pagani laurent wrote:

> The following ports are currently installed:
>    py27-pip @9.0.1_0 (active)
>    py27-setuptools @36.0.1_0 (active)
>    py35-pip @9.0.1_0 (active)
>    py35-setuptools @36.0.1_0 (active)
>    py36-pip @9.0.1_0 (active)
>    py36-setuptools @36.0.1_0 (active)
>    python2_select @0.0_2 (active)
>    python3_select @0.0_1 (active)
>    python27 @2.7.13_1 (active)
>    python34 @3.4.6_1 (active)
>    python35 @3.5.3_1 (active)
>    python36 @3.6.1_1 (active)
>    python_select @0.3_7 (active)
>
> I have just uninstalled all inactive versions of all ports but when I start python3.5 it still says it is running python3.5.2

OK, so you probably need to adjust your PATH environment variable or use
the full path when running /opt/local/bin/python3.5. If you run 'type
python3.5' it will show you which one is actually being run when you
don't use the full path.

- Josh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Kurt Pfeifle via macports-users
It is (to me) very strange!

Lorenzo>sudo port upgrade python35
--->  Scanning binaries for linking errors
--->  No broken files found.                            
Lorenzo>sudo port installed python35
The following ports are currently installed:
  python35 @3.5.3_1 (active)
Lorenzo>type python3.5
python3.5 is /opt/local/bin/python3.5
Lorenzo>python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D>>>
Lorenzo>/opt/local/bin/python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

so it claims it is 3.5.3 which is installed but when launching it says 3.5.2.
The software version not updated in the code ?

Laurent

> Le 12 juil. 2017 à 16:23, Joshua Root <[hidden email]> a écrit :
>
> On 2017-7-13 00:15 , pagani laurent wrote:
>> The following ports are currently installed:
>>   py27-pip @9.0.1_0 (active)
>>   py27-setuptools @36.0.1_0 (active)
>>   py35-pip @9.0.1_0 (active)
>>   py35-setuptools @36.0.1_0 (active)
>>   py36-pip @9.0.1_0 (active)
>>   py36-setuptools @36.0.1_0 (active)
>>   python2_select @0.0_2 (active)
>>   python3_select @0.0_1 (active)
>>   python27 @2.7.13_1 (active)
>>   python34 @3.4.6_1 (active)
>>   python35 @3.5.3_1 (active)
>>   python36 @3.6.1_1 (active)
>>   python_select @0.3_7 (active)
>> I have just uninstalled all inactive versions of all ports but when I start python3.5 it still says it is running python3.5.2
>
> OK, so you probably need to adjust your PATH environment variable or use the full path when running /opt/local/bin/python3.5. If you run 'type python3.5' it will show you which one is actually being run when you don't use the full path.
>
> - Josh

"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème" (devise Shadok)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Joshua Root-8
On 2017-7-13 00:30 , pagani laurent wrote:

> It is (to me) very strange!
>
> Lorenzo>sudo port upgrade python35
> --->  Scanning binaries for linking errors
> --->  No broken files found.
> Lorenzo>sudo port installed python35
> The following ports are currently installed:
>    python35 @3.5.3_1 (active)
> Lorenzo>type python3.5
> python3.5 is /opt/local/bin/python3.5
> Lorenzo>python3.5
> Python 3.5.2 (default, Dec 17 2016, 06:22:37)
> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> ^D>>>
> Lorenzo>/opt/local/bin/python3.5
> Python 3.5.2 (default, Dec 17 2016, 06:22:37)
> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>
> so it claims it is 3.5.3 which is installed but when launching it says 3.5.2.
> The software version not updated in the code ?

That indeed seems very strange. When I run it I see the correct version:

% python3.5
Python 3.5.3 (default, Apr 23 2017, 18:09:27)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>>

Is /opt/local/bin/python3.5 somehow a link to a different version? Does
uninstalling and reinstalling python35 help?

- Josh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

mf2k

On Jul 12, 2017, at 8:36 AM, Joshua Root <[hidden email]> wrote:

On 2017-7-13 00:30 , pagani laurent wrote:
It is (to me) very strange!
Lorenzo>sudo port upgrade python35
--->  Scanning binaries for linking errors
--->  No broken files found.
Lorenzo>sudo port installed python35
The following ports are currently installed:
  python35 @3.5.3_1 (active)
Lorenzo>type python3.5
python3.5 is /opt/local/bin/python3.5
Lorenzo>python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
^D>>>
Lorenzo>/opt/local/bin/python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
so it claims it is 3.5.3 which is installed but when launching it says 3.5.2.
The software version not updated in the code ?

That indeed seems very strange. When I run it I see the correct version:

% python3.5
Python 3.5.3 (default, Apr 23 2017, 18:09:27)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Is /opt/local/bin/python3.5 somehow a link to a different version? Does uninstalling and reinstalling python35 help?

What is the output of this?

ls -l /opt/local/bin/python3.5


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Kurt Pfeifle via macports-users
In reply to this post by Joshua Root-8

Le 12 juil. 2017 à 16:36, Joshua Root <[hidden email]> a écrit :

On 2017-7-13 00:30 , pagani laurent wrote:
It is (to me) very strange!
Lorenzo>sudo port upgrade python35
--->  Scanning binaries for linking errors
--->  No broken files found.
Lorenzo>sudo port installed python35
The following ports are currently installed:
  python35 @3.5.3_1 (active)
Lorenzo>type python3.5
python3.5 is /opt/local/bin/python3.5
Lorenzo>python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
^D>>>
Lorenzo>/opt/local/bin/python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
so it claims it is 3.5.3 which is installed but when launching it says 3.5.2.
The software version not updated in the code ?

That indeed seems very strange. When I run it I see the correct version:

% python3.5
Python 3.5.3 (default, Apr 23 2017, 18:09:27)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Is /opt/local/bin/python3.5 somehow a link to a different version? Does uninstalling and reinstalling python35 help?

Yes, it works!

(forgot to reply to the User list)

Laurent

"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème" (devise Shadok)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Joshua Root-8
In reply to this post by Joshua Root-8
On 2017-7-13 00:48 , pagani laurent wrote:

>
>>
>> Is /opt/local/bin/python3.5 somehow a link to a different version?
>> Does uninstalling and reinstalling python35 help?
>
> yes!
> And i also uninstalled and reinstalled setuptools and pip and now it
> finds pkg_resources…
> It looks like one should often uninstall things rather than upgrading...
> thanks…

Hmm, that shouldn't be necessary, but I'm glad you got it working anyway.

- Josh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Kurt Pfeifle via macports-users
In reply to this post by mf2k

Le 12 juil. 2017 à 16:40, <[hidden email]> <[hidden email]> a écrit :


On Jul 12, 2017, at 8:36 AM, Joshua Root <[hidden email]> wrote:

On 2017-7-13 00:30 , pagani laurent wrote:
It is (to me) very strange!
Lorenzo>sudo port upgrade python35
--->  Scanning binaries for linking errors
--->  No broken files found.
Lorenzo>sudo port installed python35
The following ports are currently installed:
  python35 @3.5.3_1 (active)
Lorenzo>type python3.5
python3.5 is /opt/local/bin/python3.5
Lorenzo>python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
^D>>>
Lorenzo>/opt/local/bin/python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
so it claims it is 3.5.3 which is installed but when launching it says 3.5.2.
The software version not updated in the code ?

That indeed seems very strange. When I run it I see the correct version:

% python3.5
Python 3.5.3 (default, Apr 23 2017, 18:09:27)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Is /opt/local/bin/python3.5 somehow a link to a different version? Does uninstalling and reinstalling python35 help?

What is the output of this?

ls -l /opt/local/bin/python3.5

Lorenzo>ls -l /opt/local/bin/python3.5
lrwxr-xr-x  1 root  admin  73 Apr 23 20:10 /opt/local/bin/python3.5 -> /opt/local/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5

it was the same before I uninstalled and reinstalled it… Problem solved, anyway.

laurent

"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème" (devise Shadok)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem with pkg_resources in python 3

Ryan Schmidt-24
In reply to this post by Kurt Pfeifle via macports-users

On Jul 12, 2017, at 09:30, pagani laurent via macports-users wrote:

It is (to me) very strange!

Lorenzo>sudo port upgrade python35
--->  Scanning binaries for linking errors
--->  No broken files found.                             
Lorenzo>sudo port installed python35
The following ports are currently installed:
 python35 @3.5.3_1 (active)
Lorenzo>type python3.5
python3.5 is /opt/local/bin/python3.5
Lorenzo>python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
^D>>> 
Lorenzo>/opt/local/bin/python3.5
Python 3.5.2 (default, Dec 17 2016, 06:22:37) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

so it claims it is 3.5.3 which is installed but when launching it says 3.5.2.

Did you run a third-party installer, which was itself made with MacPorts, and which was based on older versions of python35 and other ports, and which has now overwritten your up-to-date MacPorts software with out of date versions?

From time to time we find third parties that have published such installers. If you did run such a thing, please let us know what it is, and please let the publishers of the installer know that they're doing it wrong (they need to install to somewhere other than /opt/local).

Loading...