pynbody / pynbody

N-body and hydro analysis tools for Python 3. (Older versions support Python 2.)
http://pynbody.github.io/pynbody/index.html
161 stars 76 forks source link

Use on windows #502

Open SophiaNasr opened 5 years ago

SophiaNasr commented 5 years ago

Hello,

I'm new to pynbody and am looking to use it to analyze simulations. I tried to pip install it on python 3.6.5, and am receiving an error. I have installed it with Anaconda and am running it on a Windows 10 machine, and almost every package you need is installed (except special ones, like this one). Here's what it looks like:


C:\Users\phara>pip install pynbody Collecting pynbody Using cached https://files.pythonhosted.org/packages/72/f2/39fe332802298e235db2ac8662911394cd5f4558f680067d33ec2f83af3c/pynbody-0.46.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "C:\Users\phara\AppData\Local\Temp\pip-install-2miu_sx9\pynbody\setup.py", line 163, in have_openmp = check_for_openmp() File "C:\Users\phara\AppData\Local\Temp\pip-install-2miu_sx9\pynbody\setup.py", line 85, in check_for_openmp compiler = compiler.split()[0] AttributeError: 'NoneType' object has no attribute 'split'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\phara\AppData\Local\Temp\pip-install-2miu_sx9\pynbody\


I have searched for solutions online, and have found the suggestion that upgrading pip and setuptools should fix the problem; I did that (pip first, followed by setuptools), and the problem remains. If someone can help guide me as to how I can fix this?? I've also tried running the command prompt as an administrator, and this does not help. If there's any other info you need, please let me know and I'll provide it. Thank you!

apontzen commented 5 years ago

Looks to me like it can't find any C compiler on your system.

Unfortunately none of the developers have Windows knowledge so pynbody has only been tested on Linux and Mac OS. Windows could be an uphill struggle I'm afraid. Have you considered installing on a virtual machine, or using WSL?

If you do manage to get it to work on (non-WSL) Windows, it'd be great to hear how!

SophiaNasr commented 5 years ago

Looks to me like it can't find any C compiler on your system.

Unfortunately none of the developers have Windows knowledge so pynbody has only been tested on Linux and Mac OS. Windows could be an uphill struggle I'm afraid. Have you considered installing on a virtual machine, or using WSL?

If you do manage to get it to work on (non-WSL) Windows, it'd be great to hear how!

Ah, of course, the curse of the non-Mac user =( I do have virtualbox, but it's horrifyingly slow to use. Dual booting my laptop would probably void my warranty, so I don't think I can do that. Perhaps it's time for me to invest in a Mac =)

apontzen commented 5 years ago

Possibly! But if you don't want new hardware or dual booting, virtual machines or WSL both work well... I wonder why virtualbox is so slow? It's normally OK!

SophiaNasr commented 5 years ago

@apontzen is WSL faster than a virtual machine? Because the virtual machine I use is way too slow for me to even bother working on it, but if WSL is better/ faster, perhaps I'll look into that! Thanks 🙂

apontzen commented 5 years ago

Yes I think so because it’s not actually running a whole extra kernel, just a compatibility layer. But I’m no expert, would be interested to hear how well it works out for future users in a similar situation!

SophiaNasr commented 5 years ago

@apontzen if I go that route I will give an update. Thank you so much for your help!

teuben commented 4 years ago

I tried WSL and was horrified how slow the file I.O was. Like cygwin, i tried it once, and will not be back. However, unix compatibility is pretty good, that was impressive.

CharlotteRuth commented 4 years ago

SophiaNasr, did you ever have any luck installing on Windows? I am running into the same set of problems.

Anyone else have success?

SophiaNasr commented 4 years ago

I did not, unfortunately. Looks like you need Linux or a virtual box =(

Sophia Gad-Nasr Astropartigirl.com

On Wed, Jun 3, 2020, 1:05 PM Charlotte Christensen notifications@github.com wrote:

SophiaNasr, did you ever have any luck installing on Windows? I am running into the same set of problems.

Anyone else have success?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pynbody/pynbody/issues/502#issuecomment-638432565, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7BQMVSRWFYR7VIC6L2A6DRU2UHBANCNFSM4GU2VCRQ .

rokroskar commented 4 years ago

@apontzen @SophiaNasr would docker be an option? I'd be happy to put together an image for people to try

apontzen commented 4 years ago

Sounds fantastic to me! @CharlotteRuth @SophiaNasr would this be helpful to you?

I'm also curious about WSL - I keep meaning to try it out for myself, but it sounds like there is disappointing IO performance which is obviously a big problem for simulation analysis.

rokroskar commented 4 years ago

disclaimer: I have no experience with docker on windows.

Though I do have bootcamp-ed windows on my mac now so I could in theory try it out. I guess it must work similarly to how it functions on mac, i.e. not native but through a proxy VM which does incur some overhead but it's not horrible in my experience. It just makes resource juggling (disk space, memory, cpu) a bit annoying, but once you have that sorted it works well.

steventgk commented 3 years ago

Might I also suggest google's colaboratory. Similar to Jupiter notebooks on the web but can install many packages including pynbody. 12Gb ram and decent processing speeds, the only problem is hosting your data on a google drive account. May be worth looking into if changing your hardware isn't a solution. https://colab.research.google.com/

luismi98 commented 3 years ago

I was having the same issues (My OS is Windows 10) and I managed to solve it and successfully install pynbody by doing the following:

  1. First install the "Ubuntu" application from the Microsoft Store, which is basically a Linux bash for use in Windows.
  2. Run the following two commands in the Ubuntu shell:
    $ sudo apt install gcc
    $ sudo apt install g++
  3. Install and activate the linux version of Anaconda by running the following commands in the Ubuntu shell:
    $ curl -O https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
    $ bash Anaconda3-2020.02-Linux-x86_64.sh
    $ source Anaconda3/bin/activate
  4. Finally run:
    $ pip install pynbody

    So now everytime you want to code in python, do it through the ubuntu terminal. I use jupyter notebooks so I start an ubuntu terminal and do:

    $ source Anaconda3/bin/activate
    $ jupyter notebook --no-browser

    which gives you a link that you can paste in your favourite browser and code happily!