conda build a tkinter package

0 views
Skip to first unread message

Chenyang Shi

unread,
Sep 25, 2017, 11:53:57 PM9/25/17
to conda - Public
Hi everyone,

I am quite new to conda. I want to build a conda package for a tkinter GUI program I wrote. To use it in a normal way, I just navigate to the folder that contains the python file and type "python filename.py" to invoke the GUI program.

My goal now is to build a package using conda. In the end, people can install it by conda config --add MYCHANNEL filename and conda install filename. The terminal will figure out what to download and install automatically. To start the program just type the filename in the terminal to invoke the GUI. 

For example, I have a Feedback.py (and a logo.gif). It just requires a python > 3.0 to work. I put them in folder called Feedback. In the folder I also created an empty __init__.py file, a meta.yaml file. After I built it with current setting, the test part failed---no module named Feedback. 
If I comment out test session, it can be successfully built with no error, but after I locally install it conda install --use-local Feedback-0.1-py36h398df19_0.tar.bz2, I cannot invoke the program in the terminal. 

I am using Windows 10, python 3.6. So the conda-build folder contains a win-64 folder where to hold the tarball file for Windows 64 bit OS. I am planning to convert it to generate tarball files for all other platforms using conda convert -f --platform all. Is this a possible way or I have to generate file separately in Linux/MacOS systems?

I have been puzzled by this for several days. I hope someone can help me on this and point me in the right direction.

Thanks in advance.
Chenyang



Feedback.rar

Michael Sarahan

unread,
Sep 26, 2017, 9:16:16 AM9/26/17
to Chenyang Shi, conda - Public
For python modules to import, they need to be on PYTHONPATH.  It's almost always a bad idea to set PYTHONPATH directly, though.  My advice would be to start a project from a template using cookiecutter: https://github.com/audreyr/cookiecutter

Paste your project files into that structure.  In your conda-build recipe meta.yaml, run setup.py install to install your project into the correct location.

It's a little more work, but doing things this way brings you much more into line with standard practices in python packaging, and you'll have an easier time overall.

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/97b7089e-3de8-492b-8d4f-bf8e3795d6fb%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Amir Mohammadi

unread,
Sep 28, 2017, 5:36:03 PM9/28/17
to conda - Public
Hi,

I was looking at boost https://github.com/AnacondaRecipes/boost-feedstock in AnacondaRecipes which seems to be the new place for anaconda recipes.
The version there says 1.64.0 but only version 1.61.0 is available in the defaults channel.
I was wondering where do packages compiled in https://github.com/AnacondaRecipes go? Is there a beta channel or something that I can have access to?

Because I am trying to compile a program with boost 1.61.0 and using the new  libstdcxx-ng: 7.2.0-h24385c6_1 package but I seem to be getting ABI compatibility issues. You can see the log here: https://gitlab.idiap.ch/bob/bob.io.base/-/jobs/93751

The code is crashing when it is trying to handle C++ strings which just tells me something is not ABI compatible. I am betting on boost.

Also, are you using the new C++ ABI in the new packages from the defaults channel?

Thank you,
Amir

Michael Sarahan

unread,
Sep 28, 2017, 5:38:24 PM9/28/17
to Amir Mohammadi, conda - Public
You need to update conda to 4.3.27 or manually add http://repo.continuum.io/pkgs/main - conda 4.3.27 has this as part of "defaults" so it doesn't need to be manually added.

main is a new channel that we did to keep separate from the old stuff.  The c++ ABI is the new one.

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.

Amir Mohammadi

unread,
Sep 28, 2017, 5:49:10 PM9/28/17
to Michael Sarahan, conda - Public
Hi,

Thank you for the explanation. But I don't see boost there. I guess you are in the process of rebuilding everything.
It would be great if you could announce it somewhere when all packages are rebuilt.

Thanks,
Amir

Michael Sarahan

unread,
Sep 28, 2017, 5:59:42 PM9/28/17
to Amir Mohammadi, conda - Public
That is surprising.  I would have thought that it was a dependency for something in the anaconda distro.  Yes, we'll be building the rest of the packages out, and I'll try to remember to post here when boost is available.

Ray Donnelly

unread,
Sep 29, 2017, 5:34:27 AM9/29/17
to Michael Sarahan, conda - Public, Amir Mohammadi
GCC 7.2 was used.

Boost is problematic for me. conda-forge's choice of the boost-cpp name is bad in three ways. First it's a suffix instead of a prefix, second cpp is most commonly an abbreviation for C preprocessor and third prefixing C and C++ libraries with lib is what everyone else has done forever, so I would have strongly preferred libboost here with the python parts in py-boost and a metapackage called boost to encompass all of this.

Amir Mohammadi

unread,
Sep 29, 2017, 5:41:15 AM9/29/17
to Ray Donnelly, Michael Sarahan, conda - Public

Hi,

If you rename it, I'm ok with it. I'm not using conda-forge.
Is there any hard requirement to use the same names as conda-forge?

Thanks,
Amir

Amir Mohammadi

unread,
Oct 25, 2017, 5:37:13 AM10/25/17
to Ray Donnelly, Michael Sarahan, conda - Public
Hi,

I noticed that boost packages are available now in the new channel. Thank you!

I went through the dependencies of our channel and it seems that we are only missing
tensorflow and caffe with the new ABI.
Now we use these packages through their Python API.
Do you think mixing these packages with new ABI packages is going to lead to breakage?

Can we expect that these two packages will also be available with the new ABI anytime soon?

P.S. A new caffe release is ahead of us anyway: https://github.com/BVLC/caffe/releases/tag/1.0
and soon tensorflow 1.4.0

Thanks,
Amir

Ray Donnelly

unread,
Oct 25, 2017, 5:49:14 AM10/25/17
to Amir Mohammadi, Michael Sarahan, conda - Public
No problem, I needed it for RStudio. It will come down to import order. If tensorflow is the first thing to load libstdc++ and it loads an old one (from your system for example, or from the old libgcc package) and then you load something that also needs libstdc++ but needs the very new ABI in the one in libstdcxx-ng then that can cause issues.

This is because ld.so tries a specific search order for a libstdc++ that matches the ABI it needs, starting with your system paths.

Chris Barker

unread,
Oct 25, 2017, 5:15:11 PM10/25/17
to Amir Mohammadi, Ray Donnelly, Michael Sarahan, conda - Public
On Fri, Sep 29, 2017 at 2:41 AM, Amir Mohammadi <183....@gmail.com> wrote:

If you rename it, I'm ok with it. I'm not using conda-forge.
Is there any hard requirement to use the same names as conda-forge?


it's not a hard requirement, but plenty of folks have both defaults and conda-forge channels online, so it could lead to confusion.

On the other hand, having the same thing with two different names is much better than having two different things with the same name :-)

But:

conda-forge's choice of the boost-cpp name is bad in three ways. First it's a suffix instead of a prefix, second cpp is most commonly an abbreviation for C preprocessor and third prefixing C and C++ libraries with lib is what everyone else has done forever, so I would have strongly preferred libboost here with the python parts in py-boost and a metapackage called boost to encompass all of this.
 
We've tried to get a consistent naming scheme (somethign like what you suggest), but there is a lot in the conda ecosystem already with , shall we say, different naming schemes, and I'm not sure there was any real consensus moving forward.

But while I agree, it's really not a big deal: boost-cpp will be clear to people what it means. and it's part of the name, not a suffix, so I don't think anyones going to think it's C code. Also, isn't boost a largely header lib? so "libboost" isn't quite right either?

Anyway, if it's being used out in the wild, I'd stick with the same name.

Defaults and conda-forge both have a "boost" package, that appears to be Python, which is unfortunate :-(

-CHB





--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Ray Donnelly

unread,
Oct 25, 2017, 5:28:27 PM10/25/17
to Chris Barker, Amir Mohammadi, Michael Sarahan, conda - Public
I use metapackages to keep aligned with the conda-forge names: https://github.com/AnacondaRecipes/boost-cpp-feedstock/blob/master/recipe/meta.yaml#L139-L154

Chris Barker

unread,
Oct 25, 2017, 7:26:25 PM10/25/17
to Ray Donnelly, Amir Mohammadi, Michael Sarahan, conda - Public
On Wed, Oct 25, 2017 at 2:28 PM, Ray Donnelly <rdon...@anaconda.com> wrote:
I use metapackages to keep aligned with the conda-forge names: https://github.com/AnacondaRecipes/boost-cpp-feedstock/blob/master/recipe/meta.yaml#L139-L154

Thanks, seems like a good plan.

-CHB


 

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
Reply all
Reply to author
Forward
0 new messages