Installing OpenMDAO 2.6.0 Errors - openmdao

My system right now is running Python 3.5.2 with pip version 19.0.3 and I'm trying to install OpenMDAO using pip. I run the command like it says on the getting started page of the website to install:
pip install openmdao
It begins to runs but then I get the following errors:
error: can't copy 'openmdao/devtools/xdsm_viewer/XDSMjs/build': doesn't exist or not a regular file
Failed building wheel for openmdao"
Any suggestions to fix this?

I am not able to replicate your issue. Are you starting from a clean environment?
Here is my attempt:
~ $ conda create -n O35 python=3.5 numpy scipy --quiet
Solving environment: ...working... done
## Package Plan ##
environment location: /home/swryan/anaconda2/envs/O35
added / updated specs:
- numpy
- python=3.5
- scipy
The following NEW packages will be INSTALLED:
blas: 1.0-mkl
ca-certificates: 2019.1.23-0
certifi: 2018.8.24-py35_1
intel-openmp: 2019.1-144
libedit: 3.1.20181209-hc058e9b_0
libffi: 3.2.1-hd88cf55_4
libgcc-ng: 8.2.0-hdf63c60_1
libgfortran-ng: 7.3.0-hdf63c60_0
libstdcxx-ng: 8.2.0-hdf63c60_1
mkl: 2018.0.3-1
mkl_fft: 1.0.6-py35h7dd41cf_0
mkl_random: 1.0.1-py35h4414c95_1
ncurses: 6.1-he6710b0_1
numpy: 1.15.2-py35h1d66e8a_0
numpy-base: 1.15.2-py35h81de0dd_0
openssl: 1.0.2r-h7b6447c_0
pip: 10.0.1-py35_0
python: 3.5.6-hc3d631a_0
readline: 7.0-h7b6447c_5
scipy: 1.1.0-py35hfa4b5c9_1
setuptools: 40.2.0-py35_0
sqlite: 3.27.2-h7b6447c_0
tk: 8.6.8-hbc83047_0
wheel: 0.31.1-py35_0
xz: 5.2.4-h14c3975_4
zlib: 1.2.11-h7b6447c_3
Proceed ([y]/n)?
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
~ $ conda activate O35
(O35) ~ $ pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl
mkl-random 1.0.1 requires cython, which is not installed.
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-19.0.3
(O35) ~ $ pip install openmdao
Collecting openmdao
Collecting pyparsing (from openmdao)
Using cached https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl
Collecting six (from openmdao)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting pyDOE2 (from openmdao)
Collecting networkx>=2.0 (from openmdao)
Requirement already satisfied: scipy in ./anaconda2/envs/O35/lib/python3.5/site-packages (from openmdao) (1.1.0)
Requirement already satisfied: numpy in ./anaconda2/envs/O35/lib/python3.5/site-packages (from openmdao) (1.15.2)
Collecting decorator>=4.3.0 (from networkx>=2.0->openmdao)
Using cached https://files.pythonhosted.org/packages/f1/cd/7c8240007e9716b14679bc217a1baefa4432aa30394f7e2ec40a52b1a708/decorator-4.3.2-py2.py3-none-any.whl
Installing collected packages: pyparsing, six, pyDOE2, decorator, networkx, openmdao
Successfully installed decorator-4.3.2 networkx-2.2 openmdao-2.6.0 pyDOE2-1.1.2 pyparsing-2.3.1 six-1.12.0
(O35) ~ $

Related

Trying to deploy machine learning model on kubernettes, getting failed with ModuleNotFoundError: No module named 'Cython' or 'setuptools_rust'

Here is my environment yml file :-
# Conda environment specification. The dependencies defined in this file will
# be automatically provisioned for runs with userManagedDependencies=False.
# Details about the Conda environment file format:
# https://conda.io/docs/user-guide/tasks/manage-environments.html#create-env-file-manually
name: project_environment
dependencies:
# The python interpreter version.
# Currently Azure ML only supports 3.5.2 and later.
- python
- pip
- pip:
# Required packages for AzureML execution, history, and data preparation.
- azureml-defaults
- scikit-learn
- numpy
- azureml-monitoring
- cython
- setuptools_rust
And it is failing on below code:
-
deployment_config = AksWebservice.deploy_configuration(auth_enabled=False, collect_model_data=True, enable_app_insights=True, cpu_cores = 2, memory_gb = 2)
aks_target = AksCompute(ws,aks_name)
(On below line getting error)
service = Model.deploy(ws, service_name, [model], inference_config, deployment_config, aks_target)
service.wait_for_deployment(show_output = True)
Similar issue happened when the setuptools is not installed or not installed in the same path. Your setup.py file needs setuptools. Uninstall and install may help, it fix my issue.
pip uninstall setuptools
and then:
pip install setuptools
Also, sometimes pip version can cause this issue as well.
pip3 install -U pip

Install R 3.x via homebrew

The R formula https://github.com/Homebrew/homebrew-core/commits/master/Formula/r.rb was upgraded from version 3.6.3 to 4.0 semi-recently. There are a few backward-incompatible changes in version 4, so I would like to have installations of both 3.x and 4.x on my system for testing.
Can that be achieved with homebrew? A simple attempt at brew install r#3.6 just gives me No available formula with the name "r#3.6".
(Aside: the upgrade from 3.6 to 4.0 happened rather sneakily on my system, I did a brew upgrade dvc and that upgraded a few dependencies [Installing dependencies for dvc: c-ares, protobuf, grpc, gcc, openblas, sqlite, python#3.8, numpy, zstd and apache-arrow] and then an avalanche of dependents:
==> Upgrading 42 dependents:
ansible 2.9.6_1 -> 2.9.10, ansible 2.9.6_1 -> 2.9.10, awscli 2.0.7 -> 2.0.28_1,
awscli 2.0.7 -> 2.0.28_1, cython 0.29.10 -> 0.29.20, cassandra 3.11.4 -> 3.11.6_2,
ffmpeg 4.2.2_2 -> 4.3_2, ffmpeg 4.2.2_2 -> 4.3_2, gdal 2.4.4_4 -> 3.1.1_2,
gdal 2.4.4_4 -> 3.1.1_2, gdal 2.4.4_4 -> 3.1.1_2, gdal 2.4.4_4 -> 3.1.1_2,
gdal 2.4.4_4 -> 3.1.1_2, gdal 2.4.4_4 -> 3.1.1_2, glib 2.64.2 -> 2.64.3, glib 2.64.2 -> 2.64.3,
graphviz 2.42.3 -> 2.44.0, graphviz 2.42.3 -> 2.44.0, harfbuzz 2.6.4 -> 2.6.8,
hdf5 1.12.0 -> 1.12.0_1, imagemagick 7.0.10-6_1 -> 7.0.10-23,
imagemagick 7.0.10-6_1 -> 7.0.10-23, ipython 7.13.0 -> 7.16.1, jupyterlab 2.1.0 -> 2.1.5,
libdap 3.20.5 -> 3.20.6, libdap 3.20.5 -> 3.20.6, libheif 1.6.2_1 -> 1.7.0,
libheif 1.6.2_1 -> 1.7.0, maxima 5.43.2 -> 5.44.0, maxima 5.43.2 -> 5.44.0,
netcdf 4.7.4 -> 4.7.4_1, pipenv 2018.11.26_3 -> 2020.6.2, pipenv 2018.11.26_3 -> 2020.6.2,
poppler 0.87.0 -> 0.90.0, poppler 0.87.0 -> 0.90.0, python 3.7.7 -> 3.7.8,
python-yq 2.7.2 -> 2.10.1, qcachegrind 18.04.3_1 -> 19.08.3, r 3.6.3_1 -> 4.0.2_1,
r 3.6.3_1 -> 4.0.2_1, shared-mime-info 1.15 -> 2.0, shared-mime-info 1.15 -> 2.0
which is is why I'm trying to get an installation of R 3.6 back.)
Since R 3.6.3 is not actively maintained in the upstream, homebrew-core did not have a versioned formula for it. There is some hacky way of installing the most recent 3.6.3 version.
$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core # switch to your local homebrew-core folder
$ git reset --hard c3a244c627e # effective reset to the most recent r3.6.3 edition
Updating files: 100% (3680/3680), done.
HEAD is now at c3a244c627e r: update 3.6.3_2 bottle.
$ git checkout -b r-3.6.3 # this would prevent messing up your source tree
Switched to a new branch 'r-3.6.3'
$ brew reinstall r # this would reinstall 3.6.3_2
$ git checkout master # checkout back to source tree
Installation log
==> Downloading https://homebrew.bintray.com/bottles/gcc-9.3.0_1.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/de8319322428721741a0dc41dfdf2eece80e0215a7a4a861e0e206a9bfbca583?response-
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/openblas-0.3.9.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/15116c0a8d1f359f83761de72835021cbad6a814cf7fd53cc93428b522f06dda?response-
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/r-3.6.3_2.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/c6d4210a241f9466804d5660b467afb6f59d2150e43288b1c66e47387ff43f6e?response-
######################################################################## 100.0%
==> Reinstalling r
==> Installing dependencies for r: gcc and openblas
==> Installing r dependency: gcc
==> Pouring gcc-9.3.0_1.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/gcc/9.3.0_1: 1,463 files, 292MB
==> Installing r dependency: openblas
==> Pouring openblas-0.3.9.mojave.bottle.tar.gz
==> Caveats
openblas is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS in Accelerate.framework.
For compilers to find openblas you may need to set:
export LDFLAGS="-L/usr/local/opt/openblas/lib"
export CPPFLAGS="-I/usr/local/opt/openblas/include"
For pkg-config to find openblas you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/openblas/0.3.9: 23 files, 119.7MB
==> Installing r
==> Pouring r-3.6.3_2.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/r/3.6.3_2: 2,122 files, 58.2MB
==> Caveats
==> openblas
openblas is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS in Accelerate.framework.
For compilers to find openblas you may need to set:
export LDFLAGS="-L/usr/local/opt/openblas/lib"
export CPPFLAGS="-I/usr/local/opt/openblas/include"
For pkg-config to find openblas you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
version check verification
$ r --version
R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin18.7.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
legacy formula
Besides you can install thru the hacky way, I also made a legacy formula submission on this. https://github.com/Homebrew/homebrew-core/pull/58063
Note there seems to be no entry for the latest Mac big_sur in r's v3 formula, so #chenrui's method no longer works on new versions of Mac (it says Error: Failed to load formula: r: Invalid bottle tag symbol: Treating r as a cask.)
Solution: do the same as they suggest, but instead of the core repo, use the cask repo, and the revision you want to check out is 6d3bdc6 instead. Updated steps to follow:
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask # cask, not core
git reset --hard 6d3bdc6
git checkout -b r-3.6.3
HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall homebrew/cask/r # Will install v3 from cask (which works on newer Macs), not formula (which is unsupported on newer Macs)
git checkout master
# Finally, since brew won't link this cask automatically:
ln -s /Library/Frameworks/R.framework/Resources/bin/R /usr/local/bin

Custom conda package not available in R after installing from conda

I have recently created a small package (https://github.com/lc5415/HDATDS) and hosted it in conda (creating custom conda-recipe and so forth - https://anaconda.org/lucha6/r-hdatds).
Problem
Installing the package from rstudio works fine but when I install from conda (conda install -c lucha6 r-hdatds), open an r session from the terminal and run installed.packages(), I cannot see my package listed.
Reproducible example
In terminal:
conda create -n testPackage
conda activate testPackage
conda install -c lucha6 r-hdatds
#open R session
R
#within R
installed.packages() #list installed packages
I would expect to see a package called HDATDS (in capital letters) but I see no sign of it. Perhaps there is something wrong with my meta.yaml file:
package:
name: r-hdatds
version: 0.1.1
source:
git_url: https://github.com/lc5415/HDATDS.git
requirements:
- r-base
run:
- r-base
- r-dplyr
- r-ROCR
- r-tidyr
- r-e1071
- r-glmnet
- r-xgboost
about:
# user-oriented info to be displayed in anaconda.org
home: https://github.com/lc5415/HDATDS
license: MIT
summary: This package was developed as a learning exercise and also to share
useful functions for the Computational Epidemiology and Translational Data Sciences
with my colleagues from the MSc in Health Data Analytics & Machine Learning
license_family: MIT
I believe that if I run devtools::install_github("lc5415/HDATDS") from an R session from the terminal, the package is kept in future sessions but ideally the package should be automatically available from the conda installation.
Appreciate any help in fixing this issue.

How to force `conda` to install the latest version of `jupyter`?

This question is motivated by `jupyter notebook` gives error: `"Could not open static file ''"` on macOS
After conda update jupyter, jupyter --version gives jupyter-notebook : 6.0.0
However on https://github.com/jupyter/notebook, clicking Branch: master -> tags I see a 6.0.1 tag.
How can I upgrade to 6.0.1?
> conda install jupyter=6.0.1
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- jupyter=6.0.1
Current channels:
- https://repo.anaconda.com/pkgs/main/osx-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/osx-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
I can't see any candidates on https://anaconda.org
Is this a dead-end?
First, note that the actual package you want to upgrade/install is notebook, not jupyter. The Anaconda channel hasn't released that version of notebook yet. Conda Forge has it, so you can get it with
conda install -c conda-forge notebook
However, just be aware that compatibility between Conda Forge and Anaconda package builds is not guaranteed. Best practice is to create a new env that prioritizes Conda Forge from the start:
conda create -n my_jupyter_env -c conda-forge jupyter
Generally it isn't a good idea to mess with base env, and if you want something other than a default Anaconda install, I recommend starting with Miniconda and leaving base alone (other than the occasional conda upgrade conda).

Error: package or namespace load failed for 'RevoUtilsMath'

I'm getting a little bit crazy with this issue. I'm trying to install an R package using conda in my environment (python 2.7) in my home on a cluster (i.e. without root permissions). I firstly installed R in my env using:
conda install -c r r=3.4
Then:
conda install -c conda-forge python-igraph
(because igraph is required by my library of interest)
and finally:
conda install -c conda-forge r-diffusionmap
Unfortunately when I launch R the following message appears:
Error: package or namespace load failed for 'RevoUtilsMath': .onLoad
failed in loadNamespace() for 'RevoUtilsMath', details: call: NULL
error: Remove Microsoft R and then re-install. Be sure to select MKL
libraries as an install option.
During startup - Warning message:
package 'RevoUtils' was built under R version 3.4.3
What does it mean? How can I solve this?
Thank you in advance
I had this same issue after I installed some libraries (Rcpp included) in my root R, but not my conda environment (which screwed up conda). This would cause kernel death anytime a jupyter notebook running R was even opened.
The fix for me was:
Uninstall Anaconda3
Reinstall Anaconda3
Reinstall all the libraries I needed (mostly just Bioconductor in R)
A few other issues popped up, like package inconsistencies, but I dealt with those as described here.
All R packages on conda-forge (or Bioconda) are compiled against one single version or R for each new release branch (usually starting from patch 1, so 3.x.1, except for 3.4.3). This is due to ABI incompatibility problems.
Also note that defaults and conda-forge channels are (where) not binary compatible (although now they should be). And that since 2018 the default anaconda channel is distributing Microsoft R Open as default R, whether all packages from conda-forge should be preferably used with R from conda-forge.
You should be able to solve this issue by installing R using conda install -c conda-forge r-base.
the same error information for me when I open R for run code in ubuntu platform(18.4), and there is no other useful methods to solve it.My R version is 3.4.3.enter image description here

Resources