I followed the directions to install etetoolkit for mac.
# Install Minconda (you can ignore this step if you already have Anaconda/Miniconda)
curl -L 'http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh' -o Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh -b -p ~/anaconda_ete/
export PATH=~/anaconda_ete/bin:$PATH;
# Install ETE and external tools
conda install -c etetoolkit ete3 ete_toolchain
# Check installation
ete3 build check
I get an error when I run conda install -c etetoolkit ete3 ete_toolchain
Error:
UnsatisfiableError: The following specifications were found to be
incompatible with the existing python installation in your
environment:
ete3 -> python[version='>=2.7,<2.8.0a0,>=3.5,<3.6.0a0,>=3.6,<3.7.0a0']
ete_toolchain -> python[version='>=2.7,<2.8.0a0,>=3.5,<3.6.0a0,>=3.6,<3.7.0a0'
I ran the [package installer][2] for anaconda 3.7. (I don't think I actually had to do this.)
From terminal run: conda install python=2.7
Then conda install -c etetoolkit ete3 ete_toolchain
Then I verified this worked by running ete3 build check. In the results clustalo: MISSING displayed, but that's a new problem to solve.
UPDATE
The final problem was solved by running conda install -c etetoolkit ete3_external_apps
There is a type-o in the instructions given by ete3. Use this instead.
Related
When I try to generate proto files using Python's grpc_tools.protoc library:
python -m grpc_tools.protoc -I protos --python_out=. --gprc_python_out=. protos/test.proto
it fails with the error
protoc-gen-gprc_python: program not found or is not executable
--gprc_python_out: protoc-gen-gprc_python: Plugin failed with status code 1.
I've already installed the following packages in my conda environment:
conda install -c conda-forge grpclib
conda install grpcio grpcio-tools
$ python -m grpc_tools.protoc --version
libprotoc 3.6.1
What is my conda environment missing that is prevent me from running my above command? Thank you
Typo.
You want --grpc_python_out=.
You have --gprc_python_out=.
I'm trying to use make build which has a docker build but every time it reaches a layer in which it tries to install "conda install -c conda-forge r-base" it keeps failing:
Step 12/25 : RUN conda install -c conda-forge r-base
---> Running in 828e7f234ed3
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
And then it starts examining conflicts until it reaches this error:
The command '/bin/sh -c conda install -c conda-forge r-base' returned a non-zero code: 1
make: *** [Makefile:2: build] Error 1
Does somebody have any idea what I could do to fix this? So that it continues building with no errors? I didn't code the Dockerfile so I'm a little lost on what to do.
Dockerfile
FROM continuumio/anaconda3
ENV INSTALL_PATH /environment_name
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
#COPY environment.yml environment.yml
#RUN conda env create -f environment.yml
RUN conda create -n environment_name
RUN /opt/conda/bin/activate environment_name
#RUN conda config --add channels conda-forge
#RUN conda config --set channel_priority strict
#RUN conda install r-cairodevice
RUN conda install -n environment_name bokeh h5py numpy scipy pandas scikit-learn sphinx spyder jupyter statsmodels
RUN conda install -n environment_name -c bioconda pymzml
RUN conda install -n environment_name -c bioconda netcdf4
RUN conda install -c conda-forge fonts-conda-forge
RUN conda install -c conda-forge r-base
RUN conda install -c bioconda bioconductor-ropls
RUN pip install flask werkzeug gunicorn
RUN conda install seaborn
RUN echo "source activate environment_name" > ~/.bashrc
ENV PATH /opt/conda/envs/environment_name/bin:$PATH
COPY . .
RUN chmod +x run_server.sh
RUN chmod +x start.sh
ADD start.sh /
CMD /start.sh
RUN conda install -c conda-forge libjpeg-turbo
RUN git clone https://bitbucket.org/iAnalytica/mshub_process.git
RUN conda install -n environment_name -c bioconda pyteomics
#CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "api.app:app"
Makefile
build:
docker build -t environment_name .
This means that the dependencies you're listing within your conda file are causing some sort of error during the build. It could be many things, but if you were able to build that conda environment in your local environment outside of docker, then a possible culprit would be that the difference in operating system is creating a sufficient change in the dependencies that's causing the conda build to fail. Without knowing more about the error itself or the traceback, I would try commenting out half of the dependencies in your conda file and rerunning. If it succeeds, then try with the other half commented out. If it fails, uncomment half of the previously commented dependencies and continue this binary-like search until you find the offending dependency(ies).
For what it's worth, using docker removes much of the benefit of using an environment manager like conda. While I don't have visibility into the rest of your application, it might be worth considering what you're really getting out of conda in a containerized environment and determining if other means of setting up your environment better suit your needs. I say this especially because the build times for conda can be quite slow and add to the bloat of the container.
I am trying to create a conda package which should be compatible with all python versions greater than or equal to 3.7.
I specified this requirement in my conda.recipe/meta.yaml:
requirements:
host:
- python >=3.7
- pip
run:
- python >=3.7
- importlib-resources >=1.4.0
- ...
For my build command, I first activated a Python 3.7 conda environment, then I specified the build command should use the same environment, and I also specified that the build command should use Python 3.7 just to be safe:
$ CONDA_ENV=/path/to/py3.7/conda/env
$ conda create --yes -p $CONDA_ENV python=3.7 conda-build conda-verify importlib-resources>=1.4.0 # ...remaining reqs
$ conda activate $CONDA_ENV
$ conda build --python=3.7 -p $CONDA_ENV /path/to/package/dir
The build step in conda.recipy/meta.yaml too uses this same environment:
build:
script: bash -c 'source ~/.bashrc && conda activate /path/to/py3.7/conda/env && python -m pip install --no-deps --ignore-installed -vv /path/to/package/dir'
The problem
Running the above commands creates this file:
my-package-1.1.0-py310_0.tar.bz2
I don't get why py310 is in the package name, I did everything I can think of to make it compatible with 3.7 as well.
Here is what happens when I try to create an environment with both python 3.7 and my created package (after uploading the tar.bz2 file to my conda repo):
$ conda create -p ~/temp/conda python=3.7 my-package
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: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Package python conflicts for:
python=3.7
my-package -> python[version='>=3.10,<3.11.0a0']
my-package -> importlib-resources[version='>=1.4.0'] -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.8,<3.9.0a0|>=3|>=3.6|>=3.7|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0|3.4.*|>=3.9,<3.10.0a0|3.10.*']
The following specifications were found to be incompatible with your system:
- feature:/linux-64::__glibc==2.27=0
- feature:|#/linux-64::__glibc==2.27=0
Your installed version is: 2.27
But if I don't specify 3.7 when creating the environment it works fine, but creates an environment with 3.10.
$ conda create -p ~/temp/conda python my-package
Question
How can I make my-package compatible with Python 3.7?
After much unproductive research an unending amounts of trial and error, I found that I should have made my package not specific to any python version by adding noarch: python to my meta.yaml:
build:
noarch: python
script: bash -c 'source ~/.bashrc && conda activate /path/to/py3.7/conda/env && python -m pip install --no-deps --ignore-installed -vv /path/to/package/dir'
I am trying to install autosklearn in anaconda environment AutoSKLearn, after that i am using jupyter notebook and trying to import autosklearn.classification but i got this error, "ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject". How i can fix this error ?
Everyghing is explained here.
Anaconda installation
Anaconda does not ship auto-sklearn, and there are no conda packages
for auto-sklearn. Thus, it is easiest to install auto-sklearn as
detailed in the Section Installing auto-sklearn.
A common installation problem under recent Linux distribution is the
incompatibility of the compiler version used to compile the Python
binary shipped by AnaConda and the compiler installed by the
distribution. This can be solved by installing the gcc compiler
shipped with AnaConda (as well as swig):
conda install gxx_linux-64 gcc_linux-64 swig
As per autosklearn documentation, it won't officially supports on windows,
auto-sklearn relies heavily on the Python module resource. resource is part of Python’s Unix Specific Services and not available on a Windows machine. Therefore, it is not possible to run auto-sklearn on a Windows machine.
Possible solutions (not tested):
Windows 10 bash shell
virtual machine
docker image
**** How to install auto-sklearn and pyrtr on Mac OS Big Sur 11.2.1 and gcc 10.2.04 ****
This is how I successfully installed auto-sklearn on Mac OS Big Sur, under Anaconda 3
The bottleneck was to use the latest gcc compiler to install pyrfr, which is a dependency for auto-sklearn, and a couple of other things.
On Mac OS, C++ and dev tools are installed with xcode-select, and the default version of C++ compiler is not the one we need (refer to this thread):
gcc --version
The default is being /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
First, make sure everything is updated:
xcode-select --install
brew update
brew upgrade
brew info gcc
brew install gcc
brew cleanup
brew doctor
And update conda too, just in case:
conda update -n base conda
conda update --all
("conda install gcc" wouldn't work for me, like some threads suggested, and "conda config --set restore_free_channel true" did not help either)
if "frozen"
conda update -prefix /opt/anaconda3 anaconda
But "brew install gcc" installed gcc for me, and now all we need to make an alias in ~/.zshrc (or ~/.bash_profile or ~/.bashrc, if you have not switch to use zsh, which is the default in newer Mas OS)
brew gcc info
gcc: stable 10.2.0 (bottled), HEAD
GNU compiler collection
https://gcc.gnu.org/
/usr/local/Cellar/gcc/10.2.0_4
Suggested, my gcc now is in /usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10
Check:
/usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10 -v
Making an alias:
vi ~/.zshrc
add alias
alias gcc="/usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10"
source ~/.zshrc
Now, proceed with installations:
brew install swig
pip install lazy-import
pip install pyrfr --no-cache-dir
pip install auto-sklearn --no-cache-dir
Done!
Maybe, this helps:
pip uninstall pyrfr auto-sklearn
curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install
CC=/usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10 pip install lazy-import pyrfr auto-sklearn --no-cache-dir
Or, if you managed to install gcc in Anaconda3:
pip uninstall pyrfr auto-sklearn
curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install
CC=/Users//opt/anaconda3/bin/gccpip install pyrfr auto-sklearn --no-cache-dir
Maybe, you need to re-install auto-sklearn, then
pip install autosklearn --no-cache-dir --force-reinstall -I --no-deps --upgrade
Additional resources, that might help to get there:
https://medium.com/#dvdasari/install-latest-gcc-on-mac-os-x-b4ce9a66a184
http://www-scf.usc.edu/~csci104/installation/gccmac.html
https://github.com/automl/auto-sklearn/issues/155
Try:
conda install -c conda-forge auto-sklearn
https://anaconda.org/conda-forge/auto-sklearn
I'm trying to create a python virtualenv using anaconda python3.6 in ubuntu 16.04. Following https://docs.python.org/3/library/venv.html , I've tried
deploy#server:~/miniconda3/bin$ python3 -m venv ~/test
Error: Command '['/home/deploy/test/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
operating from the miniconda directory at ~/miniconda3/bin (screenshot). How can I this working?
edit:
deploy#server:~/miniconda3/bin$ /home/deploy/test/bin/python3 -Im ensurepip --upgrade --default-pip
/home/deploy/test/bin/python3: No module named ensurepip
If you are using anaconda, you should be using conda environments.
conda create --name test
For more information, see Managing Environments.
EDIT In response to OP wanting to use virtualenvs.
The error is with python not being able to find pip. You can get around this by installing it manually.
python3 -m venv test --without-pip
cd test
source bin/activate
curl https://bootstrap.pypa.io/get-pip.py | python3
At this point you will have a basic virtualenv with pip installed.