-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow other ways to install cadquery #153
Comments
I don't think it is realistically an option. Pip does not really support binary depandancies like oce. What is exactly the issue with conda? It works flawlessly on ci so I'm surprised that you are having difficulties with it. Would providing a docker image or a custom anaconda installer help? |
I think I have installed conda 5 times in total just to use cadquery. Out of those 5 times only once it worked out of the box. One of the times was on windows where it currently still isn't working. On my current OS conda doesn't work at all which means I currently run a Ubuntu VM just to be able to use cadquery. Conda to me is incredibly brittle software so I would really just prefer a normal environment. |
@rowanG077 sorry to hear that. If you are willing to share what does not work I could maybe help. I had success following those instructions: |
@adam-urbanczyk The problem with conda is that it pollutes the environment. I just removed it (again) because it was breaking everything else python-related on my machine in very pervert ways. Docker might be A solution to this. It's should be much easier to use for non-python developers, too. |
I'm working on getting a nix environment with cadquery and cq-editor going. Don't have it working yet though. @adam-urbanczyk A docker image would really help I guess. But it just seems really to extreme to resort to package managers which take over your entire system or having to run an entire second system just to be able to run a piece of software. |
@rowanG077 Feel free to look at my nixpkgs fork: https://github.com/gebner/nixpkgs/commits/cadquery CQ-editor doesn't work with the upstream pythonocc, so you might need to change the pythonocc-core sources to https://github.com/CadQuery/pythonocc-core/ |
@rowanG077 @ilya-epifanov assuming you are on Windows could you try the following way of installing miniconda:
In general I use the |
It runs fine at my Laptop (Win10 x64), too. The advantage of Conda is that you can create different environments (cqgui in the case of CQ-Editor) with different package versions. I've created and @echo off
git fetch upstream
git checkout master
git merge upstream/master
conda env update -f cqgui_env.yml -n cqgui --prune
conda activate cqgui
python run.py
conda deactivate |
@gebner Thank you! I got cadquery working in a nix environment now by using part of your commits as a reference. Are you planning on upstreaming? If not I will try to get cadquery and CQ-editor into nixpkgs. @adam-urbanczyk |
@rowanG077 Not at the moment, feel free to submit a PR to nixpkgs. |
I'm feeling like docker-on-conda is the right answer.
Conda works well when you want full control and full integration into your
environment, and for greenfield installation. Docker works well when you
want no muss and fuss just works install that disrupts nothing.
So I think the best option is the existing conda based packages, with an
additional docker container that has cq already installed (via conda of
course)
…On Fri, Jun 21, 2019, 6:27 AM Gabriel Ebner ***@***.***> wrote:
@rowanG077 <https://github.com/rowanG077> Not at the moment, feel free to
submit a PR to nixpkgs.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#153?email_source=notifications&email_token=AAJ44A74ABS3SX5BEGBSUXLP3SUHLA5CNFSM4HY6ZHU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYIC4NY#issuecomment-504376887>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJ44AZSPQ3TAGTNZTYGIMTP3SUHLANCNFSM4HY6ZHUQ>
.
|
@rowanG077 @ilya-epifanov any updates on trying the local install? @rowanG077 yes it is indeed possible to include binary dependencies in a wheel. It is not really practical though, especially for a project with so complex dependencies. If you don't believe me, take a look inside of the wheel that the project you mentioned is providing. @dcowden agreed. I'll close this issue and open a specific one for docker image. It would be great if someone from the community could pick it up - I don't have the bandwidth and experience. |
@jhol I propose to move the discussion here. |
I recently found this project which might allow easy conversion of conda to pip packages https://github.com/regro/conda-press I still don't like this approach because it will result in embedding of all the non-python (OCCT, freeimage, ... ) deps in the package. Do we really want to go this way? |
I have created nix expressions for cadquery and CQ-editor a couple of months back. I still use them. |
@rowanG077 Nice to see another nix user! I packaged cq-editor in nixpkgs, it's in 20.03 release. https://github.com/NixOS/nixpkgs/blob/20.03-beta/pkgs/applications/graphics/cq-editor/default.nix Did you manage to get this working in a non-NixOS environment? I had a go at it but ran into problems connecting the nix installed cq-editor to the Ubuntu installed graphics driver. Here is a discussion on the same problem but for a different package: NixOS/nixpkgs#9415 A solution would be to get the user to run cq-editor through this: https://github.com/guibou/nixGL but it's probably still convoluted enough to turn users away from the nix method and back to conda. |
@marcus7070 A great! I was planning on getting it into nixpkgs but never got around to it! I haven't tried it just using nix since I run NixOS. But I'd wager mine has the same problem. |
I'm working on CQ-editor flatpak, that could be used for just CadQuery. I keep you informed here: CadQuery/CQ-editor#76 (comment) |
Used command to install So I think this issue is actual.
Can't any binary files just be copied using
That would be awesome. |
The disadvantage is that Anaconda never ever seems to work, whereas in my experience venv (managed by anything but conda), system interpreter en even pipenv work flawlessly every time. Example (this is me literally trying to get this to work on my system as I type this): Step 1: conda create -n cadquery
Fixed the above problem. Let's try again:
Wut? Why would it even...!? uninstall and reinstall anaconda3 a few times to try again uninstall anaconda3 try miniconda instead manually set conda.exe env path, because that somehow didn't happen during install conda activate cadquery
k? That's probably not supposed to happen uninstalls miniconda I realize environments are left behind in some directory, removes 6 GB of environments manually install miniconda again. Installation mentions that it's recommended to start anaconda from start menu to set environment variables anaconda/miniconda does not appear in start menu Google how to set miniconda in env path Can't find conda.exe anywhere, reinstall minconda3 to let installation add miniconda to path, against installation recommendation yet according to documentation recommendation (they contract each other) Finally figured out what the problem was: I had Python 39 installed, but Conda can only handle up to Python 38 (which is unfortunate, because I would like to use dataclasses which are a Python 39 thing). Deleted all references to Python from environment variables (including Pythonhome/pythonpath), reinstalled minconda, chocolatey refreshenv, closed and reopened terminal and now the conda command works. On to the next challenge: set up Conda env in Pycharm and see if cadquery will work. Three hours later: can start coding. Day is over. Have to go to bed. Disclaimer, this is my personal opinion and I'm probably a n00b, but: I hate anaconda. Messing around with toolchains is my main frustration with coding. This is not the first time random conda crap makes my cry. I've made it work in the past, I've worked with it in the past, but I just can't get it to work now for the above reasons. It's unfortunate that this is not explained in docs that I found and even more unfortunate that Miniconda install doesn't detect that Python is already on the path and might cause problems (and I can't use system python now? I'm confused?). And this is even before all the potential environment and dependency mess. ugggggggggggg. I'm not trying to flame cadquery devs here, I love cadquery itself, it's awesome. My goal is to just give a report of "a random day of a random dude who wants to use cadquery" and the one and only massive struggle that I run into: anaconda. |
YMMV but this works in the CI: Line 17 in 4c77c87
You might be also interested in using the prepacked version of CQ-editor (and CQ), for now available from here: It is not built daily ATM though. |
I'm not sure what you mean by "conda cannot handle Python3.9", the following works for me:
Note though that OCP and CQ are not built for Python 3.9 yet. |
I'm not sure why the miniconda docs say the following then? I couldn't even get Conda itself to run at all without errors as long as I didn't have Python 3.8 installed on the system (unless conda magically started working due to some other thing a fiddled with). Or is it that: miniconda needs system Python 38 for itself to run, but can run environments within itself that are Python 39? This was answered below: yes. |
I don't understand this argument. How is a traditional webhost with x amount of bandwidth hosting a Python package more predictable and available than that exact same host seeding a torrent of the same package with the exact same amount of bandwidth? Do you believe that hosting bandwidth is somehow magically "wasted away" into the torrent network when you seed a torrent vs host a file the traditional way? |
No magic involved. Just human nature. People tend to seed only what they use/watch/otherwise utilize now. Few seed something for the greater good. Even fewer do it from always-on server. Because of that some obscure and old packages would be hard or impossible to download. This is what I was talking about. This is not the place to discuss this initiative. CadQuery is not PyPI. If I'm wrong you probably should pitch this idea to pip maintainers at https://discuss.python.org/ |
For anyone interested in @as08gf9uw0tjawtegi's torrent-based binary hosting for pip idea. I see they have started a topic at https://discuss.python.org/t/torrent-client-in-pypi-for-package-binary-distribution/9417 |
FWIW, it doesn't matter to me whether cadquery hosts on PyPI/supports pip install at all or not. I think every project should support the tooling that works best for them and their users. However I just wanted to clarify/point out a few things as a PyPI maintainer/admin! Easiest/happiest thing first. This is coming, we've had a rough idea of what to do for awhile now, and we were just missing someone with the free time to go through and write it up as a proper PEP. That happened and PEP 643 is now accepted and is currently being implemented. This is still a problem. In the linked thread under "heated discussion" (which I don't think was actually heated! but that's neither here nor there) Dustin (one of the PyPI maintainers/admins with me) laid out the problem with several possible solutions. We don't have a solution to this, but I'm pretty sure that everyone involved wants to solve this problem. Right now it's stuck in the "discuss possible ideas" phase, largely because nobody has stepped up to write, submit, and champion a PEP for a possible solution (not that that PEP would be guaranteed to be accepted, but that's how those projects make decisions). The Venn diagram of people who have the "large binary" problem, people who care/want to work on pip/PyPI, and people who have the time to work on the above is pretty small, so it'll likely languish until someone gets more time, it bubbles up to be a much larger problem, or someone external champions an idea that gets successfully accepted. |
I have CQ-editor working on my "macOS Big Sur" "MacBook Air M1" (Apple Silicon ARM based chip). I also use Windows 10 devices. I really can't remember how I installed CQ-editor (possibly the binary download?). CQ-editor (and Jupyter-CadQuery) are all very nice but I'd like use a proper IDE (in my case Visual Studio) in order to better use and understand Cadquery. This has proved extremely difficult and hence, in my research, I found this thread. Sadly, even after reading everything above, I still don't have a working solution. To increase adoption of cadquery, a key requirement is easy installation of it. That means that either installation should be a single operation or that there should be concise and clear documentation to follow (actually, there should always be such documentation). I avoid using conda because I find it buggy, difficult to use and because it causes conflicts on my systems. Should I ever manage to get this to work, I'll be documenting it. |
FYI: Last few days I've been intermittently working on my own attempt at creating Nix flakes for pywrap and OCP all that while learning how to do it properly. I know that there were some tries to do it but all links in this issue I've opened so far led to repositories almost 2 years old + attempts in nixpkgs repo seem to also have been abandoned. Please correct me if I'm wrong. Btw. my goals are following:
So far it's going good but I'm going to have to add a parameter into pywrap through which one can fully specify all clang's parameters. |
Nix is new to me. Can this package manager be used for non NixOS systems (Windows, MacOS)? I'm with you about the local install without magic. |
It works on MacOS but not on Windows, at least not natively but perhaps it could work in WSL? |
using WSL isn't for the faint hearted. |
What you say is misleading this is definitely provided but it involve conda. Anyway I see several solutions :
PS : Using WSL is actually not very complicated |
@Jojain I guess we have different ideas of what is easy. Anything that involves Having said that https://github.com/bernhard-42/jupyter-cadquery on Windows works well when using VS Code and the As far as MacOS/Apple Silicon the only working solutions appear to be the binary download of CQ-editor and the Docker image for jupyter-cadquery. Or are there some instructions that I have missed? |
@jchidley That being said, answering your first question, have you tried activating this and using an external editor : |
@Jojain using CQ-editor in this way means that it'll be working from the same python source file? In another post @wcraigtrader pointed out that CQ-editor isn't the most robust environment: it's good for smaller projects or code snippets. Given the choice, I'd rather go with the |
Yes, you open your file in cq-editor and in your editor of choice, you make your change in your editor of choice, and each time you save your file, CQ-editor notice it and rerun your file. If you have the choice I would also advice using |
I had the same problems from within Code OSS. Cadquery installation went well with conda but I had to select the conda python interpreter to make it work from within VScode. Just to rule this out :P |
I stumbled across this issue recently after reading a Hackaday article and I remember in the past (although this was a couple of years back) having issues with conda on windows (path related issues). I suspect it probably works better with a unix environment. One thing I might try experiment with if I get time is the use of https://github.com/conda/constructor
Approach 2 would be the easiest / quickest for a windows install In theory it wouldn't be idea as you'd need to manually update the libs whenever cadquery was updated, but it would avoid issues with conda / miniconda installs for those that are non technical. |
@grbd do you think that your option (2) is significantly different than the zip bundle of CQ-editor that is currently available? Regarding PATH issues on windows, you need to select certain options to get a fully portable install - we are updating the docs. |
I would say option(2) would be very similar to the zip bundle of CQ-editor, although I did notice there was no python.exe in there unless I'm missing something. The approach I've taken so far which seems to work fairly well under windows Launch the Aconda shelll
This gets things working in a directory, although I'd probably prefer option 3 personally. |
The development packages mentioned in the CQ-editor readme are based on the current master branch, are built weekly automatically, and can be built on-demand when the community wants/needs it. Python 3.10 support was merged into CadQuery 4 days ago and the builds haven't been set up for 3.10 yet.
The Windows packages include a CQ-editor.exe file. The top level of the packages has a Windows command line script instead of the exe for two reasons.
We also have the capability of building a monolithic exe file, but the startup times for that format can be glacial. |
I'd like to address some of practical points brought up in the rant(s) above, because they don't really make sense to me. It feels more like people arguing over vim & emacs rather than trying to come to a good solution to empower a community. I'm curious about a couple practical matters brought up here. First, regarding the distribution of pre-compiled binaries. Who cares about making OCCT/OCP being available as a low-level dependency to other projects? That's not what the goal is here. Just package it up and make it part of cadquery, and if people want to use it like a library they can always depend on cadquery. I just checked, and the cadquery source itself is less than 600k, so this isn't a big deal at all. Many other python bindings to C (and C++) projects do exactly this, like tensorflow. As an alternative, the OCCT+OCP component could be packaged as a tarball, .deb, homebrew, etc., and then this would be installed separately before pip installing cadquery. In the same way that we need to download and install CUDA and CUDNN from nvidia before using tensorflow, this is a pattern that works just fine. Second, the file size issue... is this really an issue? I just built opencascade 7.5 and the compiled libs + include headers are about 100 MB. I'm curious how this could become 1.5 GB with the addition of "thin" python wrappers, and whether all of the modules are even required. Maybe some of the challenge can be simplified by pruning the build output so that the end result is more manageable? Last, as a final option, the NLTK example given above which requires a download() call (which means the size is irrelevant because it can just download from a github release link) sounds quite practical. What are the drawbacks of this approach for users? Clearly by the many people who care about this issue Conda is a constant source of pain, and in some cases just isn't an option. That download call can just look in .local/lib/CadQuery to see if it's installed already, and if not download it. This is simple, easy to verify, and not error prone. CadQuery is primarily a user tool, not something that will be deployed, but even if it is that could be setup in a dockerfile and done once on build, which is how most deployments happen these days anyways. My prediction is that once cadquery is easily installable via pip so people can read a blog post and try it out in a moment of curiosity the user base, interest, projects and tools built using cadquery will all increase. |
To begin with, I care about making OCP available as a package and about having sane binary dependency management for CQ. Everything you write is possible, but to me sounds like a hacky workaround (especially the NLTK example you give). Conda offers the best effort to result ratio for delivering something working and a huge number of relevant native packages that are (or could be) used by CQ. For some reasons some people hate it, but so far no one opened a PR with a clean pipeline building a wheel. If you don't want to spend time installing a portable conda distro, why would I spend time on building a hacky pip package? Given limited resources, it is more interesting and productive to develop new features. With all that being said, there is an ongoing effort to build a wheel, but currently it has no ETA. |
I haven't tried miniforge yet but with conda and miniconda I had following serious issues:
That are my 2 reasons for not liking *Conda. |
No, it is not movable. At least not easily and reliably. See for example https://stackoverflow.com/questions/32407365/can-i-move-a-virtualenv In conda you can create as many environments as you like. Same as with venv. And you can remove them as soon as you are done with the project. Same as with venv. It is not worse than python + venv and not harder to manage. It is just different and takes some getting used to. |
Conversion became too much off-topic - locking. If anyone manages to develop a working pipeline to build CQ wheels, please open a PR! |
We're just waiting on PyPi to approve our size increase before we can make the cadquery-ocp wheel available, which will allow us to bring back |
@rowanG077 We have instructions in the README now for installing CadQuery via pip. https://github.com/CadQuery/cadquery#cadquery-installation-via-pip This addresses the OP's original request and so I am closing this issue. If there are other salient points in this issue, they can be broken out into new issues. To be clear, we are NOT dropping conda support for PyPI. Both will exist in parallel because conda has become an important part of our CI pipeline, and because some users will want/need to use conda and some will want/need to use PyPI. |
I have had nothing but trouble with conda. Everytime I have to reconfigure my machine I basically have to take a day to get conda working. Is there a possibility to move away from it and just starting using pypi?
The text was updated successfully, but these errors were encountered: