I'm currently trying to port a copy of a script I wrote in perl that uses the Statistics::R module to communicate with R from a linux -based OS to a Windows 7 OS. I have been successful at installing R and Strawberry Perl onto the system, but have hit a stumbling block when installing the Statistics::R module. One of the modules it relies upon (Regexp::Common) requires the installation of a newer version of perl than appears to be on my system- at least 5.01 as opposed to the 5.008008 that it identifies. I believe I have the latest Strawberry Perl version installed (5.24), and this works well on the system with other scripts used. I was wondering if anyone knows of a way to install a newer version of perl onto the system, or if there is an alternate way to fix this issue?
Thanks.
Use the "where" command to locate the cpan modules that are associated with the installation of new modules. Associated Perl versions can then be removed via the Programs and Features window found in the Start Menu by clicking on the "Uninstall" button. Re-installation of the latest perl version from either Strawberry Perl or other Windows- compatible Perl releases will allow for a newer Perl version to be accessed.
Related
I recently installed Ubuntu for Windows and now inside the Start Menu there are 2 new items:
Bash
Bash
This terminal opens in:
root#myName-PC:/mnt/c/Windows/System32#
Ubuntu
Ubuntu
This terminal opens in:
root#myname-PC:~#
What is the difference between the two?
For example, we want to install Git and Utils, RVM (Ruby) then clone a Git project and deploy via SSH with Capistrano commands. Should that be run with Bash or Ubuntu as above?
Also, should the commands be run in system32 or C:/ folder when inside the terminal?
Thanks
The Bash terminal is the old style (prior to Windows 10 v1790 a.k.a. Fall Creator Update). It resides in %LocalAppData%\Lxss and is managed using lxrun.exe.
The Ubuntu terminal is the new style, downloaded from Microsoft Store. The launcher part is a Windows App (%ProgramFiles%\WindowsApp) and its data resides in %LocalAppData%\Packages.
Those are two isolated installation of Windows Subsystem for Linux and do not interfere with each other. Practically you need only one of them, so choose one at your own preference.
I personally dislike the Windows Store version as it can be easily removed, which isn't a good thing for a productivity environment.
I was trying to delete the legacy "Bash on Windows" and wasn't unable to because lxrun.exe is not available in my system. But in case anyone needs it, here's how:
If you wish, you can manually delete your legacy instance. This may be required if you encounter issues uninstalling the legacy distro using lxrun.exe, or are running Windows 10 Spring 2018 Update (or later) which do not ship with lxrun.exe.
To forcefully delete your legacy WSL distro, delete the %localappdata%\lxss\ folder (and all it's sub-contents) using Windows' File Explorer, or the command-line: (using PowerShell)
rm -Recurse $env:localappdata/lxss/
The git bash vs the Ubuntu bash.
Basically there is nothing much different except maybe the versions of the bash. Because bash is bash. It's most likely different versions of bash were installed at different times for different purposes on the PC. And they will also likely be found in different folders on the PC.
Run the following code from the two different shells. This returns the version of bash:
echo "$BASH_VERSION"
On this PC, using the two terminals (MinGW and Ubuntu) returned the following versions of bash: (see image link below)
5.0.17(1) - release
4.4.23(1) - release
It's likely most people using PCs that have been around a while will find that there are two (or more) different versions of bash installed on their PCs. On this PC, the older version of bash was installed some time back.
That older version of bash might have been installed when Cygwin was installed on this PC. Or maybe the older version of bash was installed when Git was installed long ago. It really doesn't matter now. On this PC, bash is found in at least these following locations:
C:\cygwin64\bin\bash.exe
C:\Program Files\Git\bin\bash.exe
C:\Program Files\Git\git-bash.exe
The Windows 10 on this PC was updated. Specifically, the WSL kernel was updated from WSL to WSL2. Part of this update involved turning on some Windows features, including the: Windows Subsystem for Linux.
There was an old (virtual) version of Ubuntu (18.04) that had been installed on this PC some time back. But that old version of Ubuntu went away with this update. This WSL2 update changes the way Linux (Ubuntu) operates on this PC. After the WSL2 update, Ubuntu was installed from the Microsoft Store. This is Ubuntu 20.04.
This WSL2 update and the newly installed version of Ubuntu also installed a newer version of bash on this PC. And this newer version of bash is the newer version of bash that is showing above.
Another good way to understand the difference between these two versions of bash would be to enter the following into each shell:
type ping
The result should clearly show that one version of bash is providing the source from Windows while the other version of bash provides the source from Ubuntu.
ping is /c/windows/system32/ping
ping is /usr/bin/ping
Sometimes a picture is worth more than a thousand words. Attached below are two of the new Windows Terminals side by side.
These terminals show the two different versions of bash. Echo returns the older version of bash being used in the MinGW shell and Echo returns a newer version of bash being used in the Ubuntu shell.
I tried several times to install almost everything from the website, http://www.kyngchaos.com/software/qgis
However, when I open QGIS, the initial image just got stuck on the sentence "starting python" and then just quit automatically.
My mac OS version is 10.8.5
Is such a problem due to my two versions of python in my system? The python in my system is 2.7.5, and perviously I also installed a standard version of python which is about 3.3. Then I realize that I could just use the 2.7 one instead, so I just dragged the whole fold named "python" from my application folder into trashcan and use the 2.7 from terminal instead. But I'm afraid that doesn't work either...
And how can I install the QGIS correctly now? the process seems to messy to me as a beginner...
I fail to install perl module with CPAN on Mac OS X. Do you have any idea or link for my reference? Thank you.
I urge you to install perlbrew to create a local environment into which you can safely install Perl modules from CPAN without clobbering or worrying about the standard OS Perl. You will also gain the benefit of a current Perl version, far above what comes standard with your MAC.
You will need a C compilation environment 'XCode 4' in order to install perlbrew. Your install disks or the online Apple APP store offers those. Sign-up as an Apple Developer and you can download the toolset.
I have the python package in Cygwin on Windows 7. However, typing
python -V
returns
Python 2.6.8
This is a pretty low version of Python... I could use Python 3.x (whatever version is newest, preferably). I've seen some people say you have to download a .zip or .tar manually to get it (similar to this question). My questions are as follows (please note this is NOT a duplicate of the linked question):
Can I get Python 3.x somehow using the Cygwin package manager?
Can/should I get rid of Python 2.6 if I manage to get Python 3.x running? None of my code runs on anything specific to Python 2.6.
Thanks
As others have noted, the version of Python 2.6 that's installed with Cygwin is recent; Python release numbers are not linear with respect to time. The Python releases page details which versions were released on which date.
You can install Python3 if you want, using Cygwin Ports. This is a collection of Cygwin packages that are not ready for general release on the main Cygwin mirrors, but have been compiled ready to be used on Cygwin. I've written some instructions over on SuperUser which describe in more detail how to do this.
(I'd avoid installing from source, as Lennart suggests, as I'd expect this will require non-trivial fixes to make it work on Cygwin.)
As noted in the above-linked SuperUser question, there's no need to uninstall Python 2.6 to install Python 3; the two run happily side-by-side.
That said, beware your claim that "None of my code runs on anything specific to Python 2.6": Python 3.x is not back compatible with Python 2.x, and code written for Python 2.x will generally not work on Python 3.x without work to adapt it. The Python 3.0.1 What's New Guide has a good overview of the changes in Python 3.x.
Update: As of Wed 25 July 2012, Python 3.2.3 is included in the standard Cygwin installer. Just run Cygwin's setup.exe again (download it from cygwin.com again if you need to), and you should be able to select and install it like any other package.
Ok, I know how to install Perl modules with cpan and have been doing it for years. But when I try to install the DateTime module on this particular mac, it fails, claiming that it cannot find a compiler.
Here is some of the output from attempting to install one of the prerequisites, Params::Validate: ( I get the same kinds of errors from attempting to install the module in question.)
Configuring Params-Validate-1.00
Running Build.PL
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
lipo: can't open input file: /var/tmp//cc3Aefez.out (No such file or directory)
Warning: ExtUtils::CBuilder not installed or no compiler detected
Proceeding with configuration, but compilation may fail during Build
Why is Build.PL looking for a ppc compiler? If that is the problem where do I tell it (or cpan, or cpanm) that this machine is not a ppc box?
I'm running 10.6.8. The version of perl is v5.10.0 built for darwin-thread-multi-2level
I most definitely have the Developer tools installed.
I'm running cpan and cpanm via sudo.
I'd be grateful for any assistance anyone can offer.
known problem with Xcode on Lion, Apple couldn't help messing around with nm, breaking Perl again (previously) and who knows what else
p5p discussion
perlbrew's info
You are on an unsupported Perl. Upgrade to stable.
I've got 10.7 installed which comes with Perl 5.12.3 installed. I did a CPAN install:
$ sudo cpan
password:
cpan> install DateTime
And, the whole thing works. Is this something you need for a third party file, or do you want to use this because you're familiar with this particular package?
There are several built in Time packages with Perl 5.10. Would one of these work for you? Otherwise, you might need to install ExtUtils::CBuilder and see if that helps.
Or, install a more modern version of Perl such as ActiveState which is pretty simple to install, its cpan utility works pretty good on a Mac, and it's version 5.14 which is even newer than the version that comes with Lion.
I think what's happening is that the installer is trying to compile something (possibly an XS module) and to do that it needs to use the same compiler that was used to compile whichever version of Perl is on your system, and it can't find it.
Your best bet would be to install your own version of Perl 5.10 using perlbrew as this gaurantees the compiler is available (make sure you edit your .profile so Terminal uses your new Perl), then re-open Terminal, switch to the perlbrew version of Perl 5.10 and you should be fine from then on.
If you have problems installing the perlbrew Perl then as daxim noted above refer to the Lion fix