"installation of package ‘tidyverse’ had non-zero exit status" on MacOS - macos

I mostly work in Python to do data analysis, but am trying to learn R stats as well. Python, Pandas, etc are installed via Anaconda on my Mac laptop.
Today I downloaded R Studio onto my laptop, and tried running install.packages("tidyverse") to get started in R. I ran into this error:
ERROR: dependencies ‘rvest’, ‘xml2’ are not available for package ‘tidyverse’
Warning in install.packages :
installation of package ‘tidyverse’ had non-zero exit status
After Googling for a while I came across a few instances of this exact or similar issue. However, the solutions are not for Mac, e.g.,
sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev
It turns out Anaconda has already installed libcurl, libxml2 and openssl for me. Is there a way to get Rstudio to ... "look" (?) ... for the compiled libraries it needs where Anaconda has installed them?

If you know where the libraries are (say /my/lib/path) then you could use withr::with_makevars to supplement the library search path. Something like
library(withr)
with_makevars(c(PKG_LIBS="-L/my/lib/path"), install.packages("tidyverse"), assignment="+=")
Personally, I would try to limit this to only the specific packages in tidyverse that are failing, and not the whole umbrella package.

Related

pip install psd-tools3 => FileNotFoundError: [Errno 2] No such file or directory

I was trying to install Ursina but I was having trouble getting all the required packages I needed to run my code properly. Come to find out, there's a package that refuses to install called 'psd-tools3' that won't install, no matter what I do.
I've been using cmd commands like 'pip install psd-tools3' and 'pip3 install psd-tools3' but no other commands work (i.e. 'sudo pip install psd-tools3' doesn't work because my PC doesn't know what 'sudo' means and doesn't run). I've tried installing required packages for this package, but nothing works. It just keeps giving me this error:
enter image description here
I would really appreciate the help with this problem. All I can really assume is that the Python file '_version' hasn't been created and that's what's throwing the whole program off. If there is a way to add this manually and then install it, I would appreciate steps to do that as well.
I was running this on a Lenovo Thinkpad (Windows 10) on Python 3.10 (I also have Python 3.8.3 but that was installed with the 3.10) and I made sure all packages and pip are up-to-date. Still having this problem and I don't know why.
Seems to me like the issue is on the side of the maintainers of psd-tools3.
For example, looking at the content of the latest source distribution on PyPI, we can see that it does not contain any _version.py file.
This needs to be solved by the project's maintainers, but they do not have a ticket tracker. On the other hand there seems to be an "Author" email address on the project's PyPI page as well as in the project's setup.py script.
A solution might be to clone the project's source code repository (with git), and try to install from the local clone.
Just simply try
pip install psd-tools3==1.9.0
Or
pip install psd-tools3==1.8.2
This should work on your pc as well. I was having same issue, and then I tried this It worked for me

How to Fix Entry Point Not Found while installing libraries in conda environment

I'm working on Anaconda by making multiple environments in it. I have made an environment camelot and now I want to install different libraries in this environment. So for example to install pandas in this environment,
I'm writing:
conda install pandas
or
conda install -c conda-forge camelot-py
Then it gives me this error:
python.exe-Entry Point Not Found
The procedure entry point OPENSSL_sk_new_reserve could not be
located in the dynamic link library.
C:\Users\abc\Anaconda3\Library\bin\libssl11_-x64.dll
First I thought it may be because of the environment variable, thus I set an environment variable for Python, but this did not resolve the issue.
as it is suggested in here I could solve this problem by copying libssl-1_1-x64 dlls in Anaconda/DLLS to Anaconda/Library/bin (probably replacing it)
I got the same issue while updating Anaconda navigator, and got it over by replacing the file libssl-1_1-x64.dll in Anaconda3/Library/bin with the one from Anaconda3/DLLs.
As mentioned by an Anaconda maintainer here ...
moving libssl dlls around like that is really not advisable. Those
DLLs are duplicated because you have something fishy going on in your
packages. There should not be any openssl DLLs in the DLLs folder.
They should be in Library/bin
By looking at the JSON files in the conda-meta directory I found out that DLLs\libssl-1_1-x64.dll was installed by the python 3.7.0 package, and Library\bin\libssl-1_1-x64.dll was installed by the openssl package. After further investigation I found out that Python 3.7.0 does not install OpenSSL as a separate package, but Python 3.7.1 (and later) does.
Typically upgrading Python goes as expected, but if you somehow end up with both python 3.7.0 and openssl packages installed simultaneously there will be two libssl-1_1-x64.dll files and your Anaconda distribution will be broken. (You can easily verify this with the conda list command.)
I think the best way to fix it is therefore:
Rename Library\bin\libssl-1_1-x64.dll to Library\bin\libssl-1_1-x64.dll.org (your are going to need it later.)
Copy DLLs\libssl-1_1-x64.dll to Library\bin\libssl-1_1-x64.dll
Update Python to version 3.7.1 or higher, for instance with conda update python. This will remove the DLLs\libssl-1_1-x64.dll file.
Delete the current Library\bin\libssl-1_1-x64.dll file.
Rename Library\bin\libssl-1_1-x64.dll.org back to Library\bin\libssl-1_1-x64.dll. This is necessary because I got HTTP errors in the next step otherwise.
Reinstall OpenSSL with conda install openssl --force-reinstall to ensure it's up to date again.
I had the exact same issue, and it also just started today. Kind of destroyed my entire work day, tbh...
I accidentally did a conda install ... in my base environment, and it updated conda and a handful of other modules. (Conda went from 4.5.12 to 4.7.10, in my case.) Anyway, after I rolled it back, things are working as expected again.
If this is what's causing your issue, here's a fix.
conda list --revisions
conda install --revision 1 (In my case "rev 1" was my most recent, stable base environment.)
(More details about this: https://sriramjaju.github.io/2018-05-30-2-minute-recipe-how-to-rollback-your-conda-environment/)
Now I'm worried that I've inadvertently configured something in a way that isn't compatible with the newest version of conda.
Edit: Don't follow this last suggestion if you're doing anything other than playing around in a conda environment to test-drive modules. See this and this.
Lastly, if you really need to install modules and do some work ASAP, pip install [module name] was still working for me before I thought to do the reversion thing.
My problem was same. I just uninstalled anaconda, and install it again. And the problem solved.
I was receiving the same following error while updating spyder and conda package.
python.exe-Entry Point Not Found
The procedure entry point OPENSSL_sk_new_reserve could not be
located in the dynamic link library.
C:\Users\abc\Anaconda3\Library\bin\libssl11_-x64.dll
solution:
I did replace libssl-1_1-x64 dlls from Anaconda/DLLs to
Anaconda/Library/bins as suggested here.
Before opening Anaconda Navigator desktop app, I updated conda in Anaconda Prompt using conda update conda. conda successfully updated.
Then I have updated spyder using conda update spyder command in
Anaconda Prompt. spyder updated and running successfully.
For those still having similar issues with libssl11_-x64.dll or other .dll files:
Use pip install instead if you can!
I had the same issue today with libcrypto-1_1-x64.dll when trying to install plotly using
conda install -c plotly plotly
This prompts a downgrade for anaconda, and in turn raises the error:
OPENSSL_sk_new_reserve [...] libcrypto-1_1-x64.dll
Instead, using for example
pip install plotly==4.1.0
works like a charm!

How to uninstall partially installed module with Pip

I recently decided to try to install tesseract onto my computer and ran pip3 install tesseract-ocr.
It then started to download cython which alerted me to the fact that tesseract-ocr was not what I wanted, so I hit CTRL-C to cancel the command.
However, it appears that there is still a Cython folder inside my directories; pip did not clean up after the cancel. Also, I can't use pip uninstall cython because it just tells me it hasn't been installed yet.
What can I do to get a clean removal of Cython?
FWIW, the package name you gave doesn't appear to be on the global pypi index, so perhaps you left some steps out?
pip3 install opencv-tesseract
Collecting opencv-tesseract
Could not find a version that satisfies the requirement opencv-tesseract
(from versions: )
No matching distribution found for opencv-tesseract
In this type of situation, I think the answer becomes:
In the future, let it finish installing, then uninstall it once complete, so that it can clean itself up properly.
Don't panic if pip is installing dependencies of the thing you're installing. When I pip3 install tesseract-ocr as in the edited question, I see:
Collecting tesseract-ocr
Downloading tesseract-ocr-0.0.1.tar.gz
Collecting cython (from tesseract-ocr)
...
Which is totally normal and just indicates you are installing a dependency of your dependency, in this case cython, so no need to cancel it.
Install dependencies to disposable virtualenvs so that you don't pollute your global packages and file system: https://virtualenv.pypa.io/en/stable/
You will probably just have to delete the leftover cython directories.
While you can delete the files manually (usually residing in the folder site-packages, it is better to completely reinstall the package, and then use pip uninstall <package> in order to completely uninstall it.
I also had this problem when I lost power to my Pi part way through installing linux-remote.
I deleted the .whl file to resolve the problem, which was located here in my case:
/root/.cache/pip/wheels/a0/75/....../linux-remote-3.4-cp37-none-any.whl

Installing PyML and PyBrain with the Anaconda packages under OSX 10.10

Forgive me in case this too easy a question.
Background:
I installed Python 3 and Anaconda as I want to start programming Python and want to dive into machine learning.
Unfortunately all this shell based installation thing is absolutely new to me.
I managed to install python 3.6. and Ananconda 3.
Problem(s):
Unfortunately now I have several Python instances installed. One with Anaconda under user/anaconda and some under library/Python/
Now I need for a course to install PyML and PyBrain. I tried to it the "normal way". i.e. what is written on the webpage and as so often I get multiple errors during the installation.
Goal:
I'd like to have it under the Anaconda packages. Is there a way to do that?
If no: how can I get my other Python 3.6. installation to know the location of the Anaconda packages?
edit 12.08.17
The content of $PATH:
/Users/ak/anaconda/bin:/Users/ak/miniconda2/bin:/Users/ak/miniconda3/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Users/ak/.rbenv/shims:/Library/Frameworks/EPD64.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/ak/Library/Application Support/GoodSync:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin:/Users/ak/.rvm/bin
edit 12.08.17 - 2:
When I try to "conda" this libraries this happens though I started it from the unzipped, downloaded PyML:
AKs-MacBook-Pro:PyML-0.7.14 ak$ conda install -c manmadescience pyml
Fetching package metadata ...........
PackageNotFoundError: Packages missing in current channels:
pyml
And when I do this: conda install -c manmadescience pyml (found here https://anaconda.org/manmadescience/pyml)
I get the same result.

pip is not uninstalling packages

Background
I'm working on an academic project to (basically) analyze some "who follows whom" graphs and wanted to get some real data (by building some small datasets) from Twitter using one of the Python Twitter API packages in order to test some ideas I have.
I was a bit careless and installed two packages:
a) python-twitter0.8.2 (http://pypi.python.org/pypi/python-twitter/0.8.2)
b) twitter1.9.1 (http://pypi.python.org/pypi/twitter/1.9.1)
(a) is called python-twitter in pypi, and (b) is called twitter, so that's how I'll refer to them.
Both of these are called by import twitter in the Python interpreter, but when I write that line, I always get the twitter one (if I can figure out how to use the python-twitter one, I'll be able to proceed, but will still have the same underlying problem).
Problem
Since I don't need the twitter package, I decided to uninstall it with pip:
$ sudo pip uninstall twitter
which gives the output:
Uninstalling twitter:
Proceed (y/n)? y
Successfully uninstalled twitter
(actually, I tried the same thing with python-twitter and got a similar response).
However, when running pip freeze, both of these packages show up on the installed list! In fact, I can still use the import twitter command successfully in the interpreter. Clearly the packages have not been uninstalled. What I would love to know is how to uninstall them!
Other Info
I'm using Python 2.7 and Ubuntu 12.04
When running IDLE instead of the shell interpreter, and I type help('modules'), neither twitter nor python-twitter shows up in the list. When typing help('modules') into the shell interpreter, I get a segmentation fault error, and the interpreter crashes. Here's the error:
>>> help('modules')
Please wait a moment while I gather a list of all available modules...
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning:
g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning:
g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
from gtk import _gtk
** (python:2484): CRITICAL **: pyg_register_boxed: assertion `boxed_type != 0' failed
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: cannot register
existing type `GdkDevice'
from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata:
assertion `node != NULL' failed
from gtk import _gtk
Segmentation fault (core dumped)
Why other questions have not resolved this for me:
I looked at the similar post at pip freeze lists uninstalled packages and am not having the same issues.
$ sudo which pip
/usr/bin/pip
$ which pip
/usr/bin/pip
which is the same output. In addition, $ sudo pip freeze gives the same output as $ pip freeze.
Any help is very much appreciated!
You can always manually delete the packages; you can run:
sudo rm -rf /usr/local/lib/python2.7/dist-packages/twitter
to remove that package from your dist-packages directory. You may have to edit the easy-install.pth file in the same directory and remove the twitter entry from it.
While Martin's solution works, as a work around, it does not provide a direct answer.
Ubuntu's pip version for your Ubuntu version (12.04) is:
python-pip (1.0-1build1)
This is also the same version for Debian Wheezy. This version has a weired bug, which causes packages not to be removed.
If you obtain pip from upstream using the script get-pip.py you will have a fixed version of pip which can remove pacakges (as of now v. 1.5.6).
update
Python's pip is really a fast moving target. So using Debian's or Ubuntu's pip is guaranteed to have bugs. Please don't use those distribution's pip.
Instead install pip from upstream.
If you would like to register pip installed packages as system packages I really recommend that you also use stdeb.
I was facing difficulty while upgrading a package because pip was not able to uninstall it successfully. I had to delete the .egg-info and the folder as well in /usr/lib/python2.7/dist-packages and then I tried to install with --upgrade and it worked.
For me, it was due to the fact that I was running pip freeze, which gave me different results than sudo pip freeze.
Since I was uninstalling using sudo, it was not uninstalling it in the "non-sudo" session. Uninstalling without sudo fixed that.
In my case (moving pyusb 0.4x to 1.0x), removing the old package with apt-get remove python-usb and manually installing the manually downloaded package via python setup.py worked. Not pretty, but working.

Resources