# Can't find tkinter for Python 2.7



## stleric (Nov 11, 2011)

Seems a little nutty but like the title says I can't seem to find tkinter for Python 2.7.  I use [cmd=]pkg_add -r py27-tkinter[/cmd] and pkg_add says it can't find anything.  Odd thing is I can (and did) install tkinter for Pythons 2.6 and 3.1.  Can anyone tell me why that is?  And I'm running 8.2-RELEASE.


TIA
eric


----------



## caesius (Nov 11, 2011)

I think you'll find x11-toolkits/py-tkinter is what you're looking for.


----------



## stleric (Nov 14, 2011)

caesius said:
			
		

> I think you'll find x11-toolkits/py-tkinter is what you're looking for.



Okay, I found it but then what?  The link you supplied looks like it points to tkinter for 2.6.  If I go to tkinter in my ports directory and "make" will it automagically build and install the 2.7 version?  If not, how do I make it do that?

I did find a py27-tkinter in the package repo but it's not where pkg_add looks (by default).  Maybe I should throw some effort in that direction.

Thanks again,
eric


----------



## sk8harddiefast (Nov 14, 2011)

> Okay, I found it but then what?




```
make config
make install clean
```



> If I go to tkinter in my ports directory and "make" will it automagically build and install the 2.7 version? If not, how do I make it do that?


Ports have always the latest updates. If not, then you should update your ports tree

```
portsnap fetch update
```


----------



## stleric (Nov 14, 2011)

It turned out using ports was a bust.  I first did portsnap fetch/extract/update per the handbook.  Then I tried making tkinter per sk8hardiefast's suggestion.  I got, in return:

```
highlander# cd /usr/ports/x11-toolkits/py-tkinter/
highlander# make config
===> No options to configure
highlander# make install clean
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
=> Python-2.7.1.tgz is not in /usr/ports/lang/python27/distinfo.
=> Either /usr/ports/lang/python27/distinfo is out of date, or
=> Python-2.7.1.tgz is spelled incorrectly.
*** Error code 1

Stop in /usr/ports/x11-toolkits/py-tkinter.
```
At least it's looking at 2.7 and not 2.6.  

Anyway, I ended up getting the tkinter package off the "8-stable" package repository and that seemed to install okay (via pkg_add).  I got warnings about a bunch of dependencies being slightly old but my little tkinter script seems to work.  Hopefully this won't come back to bite me.

As my final request on this topic, can anyone confirm (or refute) the following statement:  "For FreeBSD 8.2 RELEASE, installing tkinter for python 2.7 is more difficult than it should be."

Thanks all,
eric


----------



## sk8harddiefast (Nov 14, 2011)

> Vulnerability check disabled, database not found


Add this line on /etc/make.conf

```
DISABLE_VULNERABILITIES=yes
```
Now try again to install it from ports.


> => Either /usr/ports/lang/python27/distinfo is out of date, or
> => Python-2.7.1.tgz is spelled incorrectly.




```
Portsnap fetch update
```
 first?


----------



## caesius (Nov 14, 2011)

> As my final request on this topic, can anyone confirm (or refute) the following statement: "For FreeBSD 8.2 RELEASE, installing tkinter for python 2.7 is more difficult than it should be."



Being pedantic, ports should only be used with the *latest* version of FreeBSD. If you're running -RELEASE then you should only use the packages built for that release.

</official_word>

On the other hand, you'll usually have no problems mixing and matching the two. I know it gets annoying when people keep saying "update your ports tree", but it is usually the solution 

I'm sure if you were to delete the directory /usr/ports/lang/python27 and update your ports tree again (to pull a clean copy), then you'd be able to install Python 2.7 without issue.


----------



## wblock@ (Nov 14, 2011)

> Vulnerability check disabled, database not found


 just means that ports-mgmt/portaudit is not installed.  It's not an error.



			
				sk8harddiefast said:
			
		

> Add this line on */etc/make.conf*
> 
> ```
> [del]DISABLE_VULNERABILITIES=yes[/del]
> ```



Please don't do that.  If you must override the vulnerability check provided by portaudit, set that variable on the command line instead of permanently setting it for everything in /etc/make.conf.

But avoid overriding that safety check.  It's there to prevent installing code with known vulnerabilities.


----------



## stleric (Nov 15, 2011)

caesius said:
			
		

> Being pedantic, ports should only be used with the *latest* version of FreeBSD. If you're running -RELEASE then you should only use the packages built for that release.
> 
> </official_word>
> 
> ...



So just doing the portsnap three-step is insufficient, I'd also have actually delete the python27 directory also?

You know, that still doesn't answer the question of why *pkg_add -r* came up empty.  I mean python/tkinter 2.7 is mature and both 2.6 and 3.1 had no problems.  (I think the reason I have 2.6 is because 2.7 was such a hassle).

Thanks again,
eric


----------



## caesius (Nov 15, 2011)

stleric said:
			
		

> So just doing the portsnap three-step is insufficient, I'd also have actually delete the python27 directory also?


No, I suggested that in case you had manually made changes to the ports directory while attempting to fix the problem. portsnap fetch update is sufficient.



			
				stleric said:
			
		

> You know, that still doesn't answer the question of why *pkg_add -r* came up empty.  I mean python/tkinter 2.7 is mature and both 2.6 and 3.1 had no problems.  (I think the reason I have 2.6 is because 2.7 was such a hassle).



pkg_add -r would have tried to fetch the package that was created when 8.2-RELEASE was released. It is likely that py27-tkinter didn't exist when 8.2-RELEASE was created, so it can't be found. You can get newer packages by setting the PACKAGESITE environment variable. This is again not officially recommended, but will probably work. In case you're wondering, the *proper* way to use the latest ports/packages is to track STABLE or CURRENT.


----------



## sk8harddiefast (Nov 15, 2011)

```
DISABLE_VULNERABILITIES=yes
```
 commented in my /etc/make.conf.


----------

