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
Numpy again (and NetworkX) in DrawBotPy3 #209
Comments
do you have python 3.6 installed on your local system? and is numpy installed for python3? DrawBot finds the local site packages the python version and makes all those packages available inside DrawBot |
Also: Python 3.6 needs to be from python.org, not homebrew. |
Frederik, I installed 3.6 with the macOS 64-bit/32-bit installer at https://www.python.org/downloads/release/python-365/. I see the version in Macintosh HD/Library/Frameworks/Python.framework/Versions/3.6 From Terminal I was able to install both numpy and NetworkX with I see Python 3.6 in the package contents for DrawBotPy3, too (Contents/Frameworks/Python.framework/Versions). But nothing in my user account. |
so this works in terminal
drawBot add these paths available https://github.com/typemytype/drawbot/blob/master/drawBot/scriptTools.py#L94-L97 if the packages are not available there, drawBot will not find it |
Seems so, here's the Terminal log: Last login: Tue Jun 5 15:01:25 on ttys000
|
mmmm.... its installed in your user... must be available in |
Do these lines:
reference MacintoshHD/Library or my user library? |
Just checked: nothing in the fallback System/Library/etc. … |
So, I know this is like asking how you sharpen a pencil, but: if I want these packages installed globally, how would I do that in Terminal? It looks to me like I can't even find Python 3.x.x in the root Library/Python, though I do see it in the root Library/Frameworks/Versions folder … |
Try to leave out the |
Here's the log without the --user flag. Like I wrote, the funny thing is that I don't even see Python 3.6 in ./Library/Python at all, nor in ./System/Library/Frameworks/Python.framework/Versions—though I do see it in ./Library/Frameworks/Python.framework/Versions. ART-C02PV4VHFVH8:~ meilleurmj$ python3 -m pip install numpy scipy matplotlib ipython jupyter pandas sympy nose |
Ugh, maybe you need to uninstall the packages first, before they properly get installed without the --user option. I assume (We really need to bundle pip with DrawBot and have a proper way to do these things.) |
I'll give it a try—uninstalling went without anything that looked like a problem. Sorry to be bothering you guys with such low-level stuff … |
Okay, partway there: here's the log for both new installs:
New window in DBPy3, here's the code:
and here's the output: nothing wrong with just numpy (hooray!), but with the networkx call:
|
Maybe |
That did it! I think.
None of these throw any flags. Tomorrow I'll give them a try. Thanks, you two! |
Close #209 |
Well, this is embarrassing: I'm trying to get a new laptop set up, and figured I'd refer to this issue thread: install Python 3.7 from the python.org package (and not HomeBrew), install numpy and networkx either with pip3 or python3 -m pip and without the --user flag … and guess what? import networkx both throw ModuleNotFoundErrors. Clearly I'm in for remedial training, but I could use any advice I can get right now—sketches I'm working on use both modules, and I'm stuck without them … |
DrawBot uses Python 3.6, so you need to make sure that your modules are being installed for that version of Python (not 3.7). with pip: |
Thanks, Gustavo—I didn't understand how modules are made available to which versions of Python, and now I (sort of) do. Fixed. |
(PS: since Just closed the last version of this issue, I can't re-open it—sorry.)
Hate to dig up an old issue, but I'm at a point in a current project in DBPy3 where I am ahead of my skis regarding graph and network functions, and could sure use numpy and NetworkX. I can import numpy in the 2.7 version of DrawBot thanks to last year's thread and Just/Frederik's help (thanks again, guys), but not NetworkX—and I can't import either one in Py3.
I'm happy to download and install these modules by hand and update directories myself—for whatever reason, perhaps because of permissions issues with a school machine, who knows—I can't install these modules with pip (either pip can't find them or appropriate versions of them, or DB can't find them once they're installed, and sudo runs me into permissions errors). I just need to know where to put them and what edits to what scripts need making. (Again feeling the shame of being a Python dilettante, sorry.)
The text was updated successfully, but these errors were encountered: