Forums

Conda enviornment

I set up and initialized conda as per these instructions but fail to create an OSMnx environment as described here with this command:

conda create -n ox -c conda-forge --strict-channel-priority osmnx

Here is what I get:

15:04 ~ $ conda create -n ox -c conda-forge --strict-channel-priority osmnx
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: - 15:18 ~ $ conda info --envs
# conda environments:
#
base                  *  /opt/conda

I got a notification that the process has been killed because it exceeded the RAM limitations. Since setting up the environment really only happens very occasionally, I am wondering if there is a workaround to get this set up?

I'm not sure what we can do about that. Is it the initial "conda create" that is killed for using too much RAM?

Yes, it's the conda create that's killed for exceeding RAM. In an ideal case I only need it once...is there a workaround for very, very occasional RAM exceeding cases?

Looks like the dependencies of osmnx are defined in such a way that solving of the environment takes huge amount of memory. We can't do anything about that at the moment, but it's possible that when we deploy new system image with new conda with new solver with the lower memory footprint that would fix the issue. Unfortunately there is no fixed date.

Thank you, I will be on the lookout for a new system image. I am guessing there is no way to create the environment somewhere outside of the RAM limit and then clone it into my workspace. I am guessing osmnx will not be the only environment that one currently cant create on pythonanywhere, so maybe a limitation that you guys should keep in mind. Thanks anyway

You could try solving the environment locally then exporting the solved environment to PA. If it's the solving that really is using all the space the you should be able to sidestep the issue by solving on your local machine.

So this would entail installing the environment locally, exporting with conda env export > environment.yml, copying the yaml to PythonAnywhere and conda env create -f environment.yml

That's a great idea and it seems to work...almost:

ResolvePackageNotFound: 
  - libiconv==1.16=he774522_0
  - libglib==2.72.1=h3be07f2_0
  - fonttools==4.34.4=py310he2412df_0
  - scipy==1.8.1=py310h33db832_0
  - tiledb==2.9.5=h5689973_0
  - libspatialindex==1.9.3=h39d44d4_4
  - jpeg==9e=h8ffe710_2
  - libcblas==3.9.0=15_win64_mkl
  - hdf4==4.2.15=h0e5069d_3
  - m2w64-libwinpthread-git==5.0.0.4634.697f757=2
  - m2w64-gmp==6.1.0=2
  - libzip==1.9.2=hfed4ece_0
  - cairo==1.16.0=h0ac17fb_1011
  - libpng==1.6.37=h1d00b33_3
  - vc==14.2=hb210afc_6
  - snappy==1.1.9=h82413e6_1
  - markupsafe==2.1.1=py310he2412df_1
  - krb5==1.19.3=h1176d77_0
  - libnetcdf==4.8.1=nompi_h1cc8e9d_102
  - libxcb==1.13=hcd874cb_1004
  - rtree==1.0.0=py310h1cbd46b

any idea how I can make sure these and other packages are found?

Try moving them under the pip section of the yaml

Thanks, I moved it under pip3.10 as follows

channels:
  - conda-forge
  - defaults
dependencies:
  - pip3.10:
    - affine=2.3.1=pyhd8ed1ab_0
    - attrs=21.4.0=pyhd8ed1ab_0
    - bcrypt=3.2.2=py310he2412df_0
    - blosc=1.21.1=h74325e0_3
    - boost-cpp=1.74.0=h9f4b32c_8
    - branca=0.5.0=pyhd8ed1ab_0

after trying pip - but both didnt work, the former gives me:

(base) 13:57 ~ $ conda env create -f oxexport.yml
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Unable to install package for pip3.10.
Please double check and ensure your dependencies file has
the correct spelling.  You might also try installing the
conda-env-pip3.10 package to see if provides the required
installer.

I am sure thats me not understanding how to use the yml file with the pip / pip3.10 dependencies...

Many thanks!

Could you try removing the platform identifiers, thats the "=pyhd8ed1ab_0" bit of each line

Ok, I removed the platform identifiers in each line, so the environemnt.yml looks like this (shortened):

name: ox
channels:
  - conda-forge
  - defaults
dependencies:
  - pip3.10:
    - affine=2.3.1
    - attrs=21.4.0
    - bcrypt=3.2.2
    - blosc=1.21.1
    - boost-cpp=1.74.0
    - branca=0.5.0

I then get this

16:43 ~ $ conda env create -f environment.yml
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Unable to install package for pip3.10.
Please double check and ensure your dependencies file has
the correct spelling.  You might also try installing the
conda-env-pip3.10 package to see if provides the required
installer.

All a bit above my paygrade - any suggestions?

Looks like there's no "boost-cpp" in pypi https://pypi.org/search/?q=branca&o=. So it's probably a conda package