I usually install R packages using the command below, but it will not work for the network graph ad-on iGraph. T think this is because I am using the new version of R (2.12) which seems to have changed package installation (now split between i386/x64).
My question is, what is the easiest way to get up and running with iGraph. Should I get up to speed troubleshooting compiling in windows, or should i downgrade to an earlier version of R?
> install.packages('igraph', type='source')
trying URL 'http://ftp.heanet.ie/mirrors/cran.r-project.org/src/contrib/igraph_0.5.5.tar.gz'
Content type 'application/x-gzip' length 1135577 bytes (1.1 Mb)
opened URL
downloaded 1.1 Mb
* installing *source* package 'igraph' ...
ERROR: configuration failed for package 'igraph'
* removing 'C:/PROGRA~1/R/R-212~1.0/library/igraph'
The downloaded packages are in
‘C:\Users\SSSS\AppData\Local\Temp\RtmpN4LiQG\downloaded_packages’
Warning message:
In install.packages("igraph", type = "source") :
installation of package 'igraph' had non-zero exit status
In version 2.12.0 using the following GUI commands worked for me
Packages -> Select Repositories -> CTRL Click all repositories
Packages -> Install Packages -> Click igraph
Once you have this done, be sure to add "library(igraph)" to your script.
Generally users of Windows packages are discouraged from be installing from source, but I see that the Windows version has not passed CRAN Package checks. Have you gotten Murdoch's RTools bundle downloaded and properly configured?
Here's a link that may be useful if your target is Win64:
http://r.789695.n4.nabble.com/Rtools-for-building-64-bit-windows-packages-td2021034.html
Related
I have tried conda install -c conda-forge r-Cubist, but no arm64 package in the arm64 channel.
The CRAN has the newest release which is the arm64 package, I tried to download the release version:macOS binaries: r-release (arm64), and put this package to /Users/rui/miniforge3/lib/R/library and run the code importr('Cubist')
but the error is:
rpy2.rinterface_lib.embedded.RRuntimeError: Error in library.dynam(lib, package, package.lib) : shared object ‘Cubist.dylib’ not found.
I checked the difference between the package downloaded from the CRAN package and the package downloaded from conda install -c conda-forge r-packagename, the lib folder of the former one has "so" file, and the latter one has "dylib" file.
How to use the arm64 r-package from the CRAN website in python? or how to get the 'dylib' file in the R package.
Update:
Following the question Using conda to build and install local or custom R package, I tried
conda skeleton cran <pckg>
conda-build r-<pckg>
conda install --use-local r-<pcgk>
However, which needs r-base=3.5,the arm64 architecture requires r-base==4.2.1.
Unsatisfiable dependencies for platform osx-arm64: {'r-base=3.5'}
Update:
The best way to solve this problem is to use the code that #onyambu provided and change the environment to google colab.
I cannot reproduce/work out your case since I'm running Windows, but you can try the following in Python:
from rpy2.robjects.packages import importr
# one-time execution to build & install the Cubist R package
utils= importr('utils')
utils.chooseCRANmirror(ind=1)
utils.install_packages(StrVector(['devtools']))
devtools = importr('devtools')
devtools.install_github('topepo/Cubist')
# if success you can then import the package
Cubist = importr('Cubist')
The install_github may fails if you don't have a compiler toolchain already set up. (e.g., Windows R needs Rtools package)
GTK+3 v3.24 is downloaded from Gitlab and extracted from zip file.
After running Meson, it gives the following error when meson setup --prefix C:\Users\user\Desktop\gtk\gtk-gtk-3-24 builddir command is run:
meson.build:359:0: ERROR: Git program not found.
No Git programs are installed on my machine (Windows 10 x64). But source code is downloaded. Meson and Ninja are installed by using pip command.
What is the problem?
The problem that in addition to GTK sources you need to provide all required dependencies: some dependency is not found -> meson tries to use "fallback", i.e. download some subproject from git, probably this is glib dependency:
glib_dep = dependency('glib-2.0', version: glib_req,
fallback : ['glib', 'libglib_dep'])
Here you can find the list of some of required packages:
You will also need various dependencies, based on the platform you are
building for:
GLib
GdkPixbuf
GObject-Introspection
...
But instead of painful process of setting up all these, why not just trying to use tool that is recommended to setup GTK on Windows? Check gvsbuild project or MSYS2, both described here.
I'm trying to install a pysnap library from github. This is part of the output I get. I have no idea how to proceed, any help would be greatly appreciated.
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pysnap-0.1.1-py2.7.egg
Processing dependencies for pysnap==0.1.1
Searching for cryptography>=1.2.2
Reading https://pypi.python.org/simple/cryptography/
Best match: cryptography 1.2.3
Downloading https://pypi.python.org/packages/source/c/cryptography/cryptography-1.2.3.tar.gz#md5=5474d2b3e8c7555a60852e48d2743f85
Processing cryptography-1.2.3.tar.gz
Writing /tmp/easy_install-7ZnmT5/cryptography-1.2.3/setup.cfg
Running cryptography-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7ZnmT5/cryptography-1.2.3/egg-dist-tmp-rcoXcx
_configtest.c:1:1: error: thread-local storage is unsupported for the current target
__thread int some_threadlocal_variable_42;
1 error generated.
error: unable to create target: 'No available targets are compatible with this triple, see -version for the
available targets.'
1 error generated.
What platform are you trying to install pysnap?
I downloaded and installed pysnap sucessfully from this github location
I do have windows 10 platform and python 2.7 though. I dont' have a linux to replicate this issue.
If you are trying to install on Linux, depending on flavor and its setup , sometimes swap is setup as as /tmp and some applications are not able to write to /tmp. In your case it does looks like its trying to write to /tmp and erroring out.
Can you try pip install cryptography
and see if its able to install cryptography part without issues?
Once that dependency is out of way, you can install pysnap so that pysnap will not try to install cryptography
Trying to install this Python IRC bot called Willie. This is what happens when I run setup.py:
C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.1\helpers\pycharm\pycharm_setup_runner.py" C:\Users\Quibbles\Documents\willie-5.3.0\setup.py
Testing started at 1:35 PM ...
running pycharm_test
Searching for pygeoip
Best match: pygeoip 0.3.2
Processing pygeoip-0.3.2-py3.4.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\pygeoip-0.3.2-py3.4.egg
Searching for pyenchant
Best match: pyenchant 1.6.6
Processing pyenchant-1.6.6-py3.4-win32.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\pyenchant-1.6.6-py3.4-win32.egg
Searching for praw
Best match: praw 2.1.21
Processing praw-2.1.21-py3.4.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\praw-2.1.21-py3.4.egg
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 3.4.4
Downloading https://pypi.python.org/packages/source/l/lxml/lxml-3.4.4.tar.gz#md5=a9a65972afc173ec7a39c585f4eea69c
Processing lxml-3.4.4.tar.gz
Writing C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\setup.cfg
Running lxml-3.4.4\setup.py -q bdist_egg --dist-dir C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\egg-dist-tmp-0expfysa
Building lxml version 3.4.4.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
Process finished with exit code 1
What am I doing wrong? I downloaded the source code from https://github.com/embolalia/willie/releases/tag/v5.3.0 and tried running setup.py in PyCharm.
It should be fairly obvious by the error messages:
** make sure the development packages of libxml2 and libxslt are installed **
You need to have the dev libxml2 and libxslt installed. It appears either you have the wrong versions perhaps, or don't have them installed properly.
I'L'I's answer gives you a hint of where to start searching next, but isn't a useful answer.
After several attempts on my own, I found that to get the lxml library installed, I needed to do the following:
First, download the lxml library from http://www.lfd.uci.edu/~gohlke/pythonlibs/
This is necessary because the PiPy archives (https://pypi.python.org/pypi/lxml/3.4.4) are way out of date, only giving you the option to install for Python 3.2 for the 3+ series, which of course is useless if you're on 3.4. There's also issues if you're using 64-bit. They may be sufficient if you're using 2.7, though.
Then use the instructions here: How do I install a Python package with a .whl file? to install the .whl file.
However that only fixes half the problem. The willie package appears to be broken in other ways (on Windows) because of trying to reference a unix-like /tmp directory (absolute path) instead of the proper Windows Temp directory.
This issue describes the problem, though no fix has yet been made: https://github.com/embolalia/willie/issues/811
It indicates that it's a Windows-specific bug in the installer. To work around that, download the .tar.gz from https://pypi.python.org/pypi/willie/5.3.0
Unpack it. Go to the willie-5.3.0\willie.egg-info directory, and edit the SOURCES.txt file. The fifth line is /tmp/tmpeAhjCF/willie. Delete that line.
Repackage the directory into a .tar.gz archive. Install via pip install .\willie-5.3.0.tar.gz.
Now it's installed, and you're ready for the next round of problems of actually getting it to run on Windows. Since I haven't actually succeeded in doing that yet, that's as far as I can help for right now.
I would like to try zeroRPC but couldn't install the package properly. I am using the latest python_xy distribution (python 2.7.3) under windows 7 and I must say I don't have much experience with installing new modules since the distribution is allready pretty complete.
I pulled the master zeroRPC-python from gitHub and tried to do "python setup.py install"
I had a first problem with something like "impossible to locate vcvarsall.bat". I solved it by installing mingw as explained here error: Unable to find vcvarsall.bat
Then I could run the install untill the end, but now, when I import zerorpc, I get the following ImportError (only the end of the stack):
C:\Python27\lib\site-packages\gevent-0.13.8-py2.7-win32.egg\gevent\greenlet.py in <module>()
4 import traceback
5 from gevent import core
----> 6 from gevent.hub import greenlet, getcurrent, get_hub, GreenletExit, Waiter
7 from gevent.timeout import Timeout
8
C:\Python27\lib\site-packages\gevent-0.13.8-py2.7-win32.egg\gevent\hub.py in <module>()
28
29 try:
---> 30 greenlet = __import__('greenlet').greenlet
31 except ImportError:
32 greenlet = __import_py_magic_greenlet()
ImportError: No module named greenlet
I wonder more generally if I am following the right procedure to install new packages (under windows) or if there is a simpler way (safer with dependancies) that I would be overlooking (easy_install)? I must say I am very new to this and any hints or link to the relevant documentation would be appreciated.
Thanks in advance,
Samuel
I was struggling with this question myself for a while now. The solution involves several components, and many answers out there seem to relate to different versions of those components that don't always play well together.
Here is the complete solution that worked for me, starting from an empty virtualenv:
mkvirtualenv myenv
python -m pip install --upgrade pip==6.0.8 wheel==0.24.0
pip install gevent-1.0.1-cp27-none-win32.whl pyzmq-13.1.0-cp27-none-win32.whl zerorpc==0.4.4
The first step installs wheel and upgrades pip itself to support wheel package installations. The next step installs binary wheels for gevent-1.0.1 (downloadable from this unofficial but extremely useful python windows binaries page) and pyzmq-13.1.0 (available here), and the zerorpc-0.4.4 package from source in the usual way.
Note that I hard-coded source package versions here (pip 6.0.8, wheel 0.24.0, zerorpc 0.4.4) because as I said other versions don't always follow the same build patterns. This may not be necessary and future versions may prove to work just as well together.
The final result for me:
(myenv) C:\work>pip freeze
gevent==1.0.1
greenlet==0.4.5
msgpack-python==0.4.5
pyzmq==13.1.0
wheel==0.24.0
zerorpc==0.4.4
I used a slightly different way, I am using Anaconda + Jupyter to run my python notebooks.
I used this link to zerorpc package, and installed using
conda install -c groakat zerorpc
which installed following -