Perl & CPAN upgrade help for OS X - macos

Here is my problem. I am running OS X v10.7 (Lion) and want to set up an old Perl program I have written (was then using a Windows System with ActivePerl and then its ppm).
I read to use CPAN to install Perl modules (I am trying to install the Graph module). Whenever I tried to install it, it failed from a refused connection. Why? So I read that I should run the following to update CPAN and fix any broken links:
cpan> install Bundle:CPAN
cpan> reload cpan
cpan> index cpan
cpan> exit
However, after doing this I am stuck with this every time I try to do a CPAN install or upgrade:
New CPAN.pm version (v1.9800) available.
[Currently running version is v1.9456]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
I was trying to use the default Perl stuff that is included in OS X rather than downloading ActivePerl. How do I fix CPAN and install the Graph Module?
PS: Running install CPAN and reload CPAN didn't do anything, but it generated the same message.
UPDATE
I was able to upgrade to v1.9800 doing a manual install (make, install) through the terminal. But I am still unable to install the Graph Module. Here is what I am getting:
http://cloud.jjnford.com/3D1C1H4217222b1p1O3a
UPDATE - PROBLEM SOLVED
I was finally able to solve the problem. I just moved the /User/jj/.cpan directory to User/jj/.cpan_bak and then reconfigured CPAN and the Graph Module installed with no fuss.

To solve this problem, do a manual upgrade of CPAN (apparently on OS X CPAN has trouble upgrading itself). You can download the source from here. After you have downloaded it uncompress it, create the make file from the Perl script, then run a make test, and finally if all goes well a make install.
$> tar -xvxf CPAN-1.9800
$> cd CPAN-1.9800
$> perl Makefile.PL
$> make
$> make test
$> make install
Now get rid of your old CPAN configuration:
$> mv ~/.cpan ~/.cpan.bak
Now when you run CPAN from the terminal you should be prompted for the configuration again. Once this is complete and CPAN has started you will notice this:
cpan shell -- CPAN exploration and modules installation (v1.9800)
So CPAN is now upgraded and working, and in my case I installed the Graph Module:
$cpan> install Graph
And everything works fine. I hope this helps somebody.

I have a fresh Mac OS X Lion and I updated CPAN without problems.
Installing XCode is not enough. Make, gcc, g++ are not installed by default.
To install them, one has to:
Start XCode, go to XCode->Preferences->Downloads and install component named "Command Line Tools".

I know this was solved, but do consider using "cpanminus" instead next time. It's faster and could save you a lot of hassle. You can either install App:cpanminus using cpanminus (see: App::cpanminus):
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
And then to install any module and its dependencies simply run:
cpanm <module>
Alternatively you could use it directly from the web:
curl -L http://cpanmin.us | perl - --sudo <module>
I use it on my OS X Lion, and it works perfectly :)

Please excuse me for replying to this old post.
I had the same issue as the OP. Once I corrected the command to contain two colons instead of one (i.e. - Bundle::CPAN vs Bundle:CPAN), it worked as expected.

Related

Error Installing DBD::MariaDB on Mac OS Sierra - Fails on Creating t/MariaDB.mtest

I am having difficulty getting the DBD::MariaDB module to install on an instance of OSX 10.12.6. I am using homebrew and perlbrew, and other cpan modules installed without issue with cpanm.
I have used homebrew to install openssl and mysql-connector-c as the cpan Install page recommended.
Rather than trying to use cpanm for this, I am attempting to install manually so I can specify a mysql_config location. I have a heavily customized instance of MariaDB 10.2.21 installed so nothing is "default." If it's relevant, my MariaDB configuration was based off a brew install.
I am stuck at this point: Failed to create t/MariaDB.mtest: No such file or directory at /Documents/DBD-MariaDB-1.21/Makefile.PL line 415. Fails to make the file and I'm doing this with user directories with perlbrew.
Using Perl 5.26.1 on perlbrew 0.86 (latest). Not sure what to actually do here. Not sure why I'm unable to make the file in a user folder.
Did I miss a crucial step?

How do I install ack on OS X (10.8.4)?

I am new to OS X and I am unable to figure out how to install ack. The instructions here didn't help, because the command "install" is failing. Please guide me proper commands.
So far, I have downloaded ack 2.04 and placed it in the /usr/bin folder and then ran perl Makefile.PL successfully. The next command install isn't working for me.
If you use Homebrew you can simply do:
$ brew install ack
If you are new to OSX I highly recommend this approach because it makes installation of stuff like this MUCH easier. It is a package manager for OSX.
Homebrew link: http://brew.sh/
You can also use the MacPorts installer for OSX:
sudo port install p5.<nn>-app-ack
where <nn> is the version of your Perl installation (Ack is written in Perl). If you don't know the version of Perl you have installed, just type:
perl --version
and you'll know what you need for the port command. The Ack installation page has the information you need for this. More information about MacPorts can be found here.
Searching the web, you'll find LOTS of opinions about Homebrew versus MacPorts. I've used both; they both work (and both fail occasionally - installation of this kind is complex). You'll need to pick one or the other and stick with it as Homebrew doesn't play nicely with MacPorts (or vice versa, depending on your POV). Overriding choice for me is MacPorts as it has many more packages than Homebrew and it puts its stuff in /opt/local to stay out of the way of other programs. YMMV

Incorrect check of SIP version during PyQt installation

I have been trying to install PyQt on my mac (OSX 10.6.8), but I still having this problem:
When I try to install PyQt-mac-gpl-4.9.6, I get this
Error: This version of PyQt requires SIP v4.14.2 or later.
The weird thing is that when I want to check for sip version on the console and write
sip -V
,I get the correct version: 4.14.2
I have checked my PATH but non of the online tips that I have found have helped me. How do I fix this?
I would recommend checking to see if you have sip installed in different locations, with the newer version being in a path that is not at the head of your PATH.
mdfind -name sip | grep '/bin/'
This should tell you all of the sip binaries on your computer. Check the version of all of them, and then make sure that path is at the front of PATH
What it could actually be, regardless of it seeming like you only have one sip, is a leftover .pyc file that is getting picked up before your intended sip. Try this to confirm:
$ python
>>> import sipconfig
>>> print sipconfig
This will tell you where it is finding sipconfig. If it looks like the wrong spot, or if you check it and all that is left is the pyc file, remove it. Then your newer sip should be found properly.
I had a similar issue after installing sip 4.14.2 over a previous version of 4.13.1 on Mac OSX 10.7.4 and Python 2.7. Strangely, the version of sip from the command line was different from the version from the Python sipconfig module.
$ sip -V
4.14.2
$ python -c "import sipconfig; print sipconfig.version_to_string(sipconfig.Configuration().sip_version)"
4.13.1
I ran through the install again, this time with running the install step as 'sudo make install' and the two versions matched at 4.14.2 and the PyQt instal was successful.
$ cd ~/Downloads/sip-4.14.2/
$ python configure.py
$ make
$ sudo make install

Installing a perl module from CPAN on XAMPP for Windows

I'm pretty rusty with Perl and I don't think it's helping that I'm running it in Windows.
I'd like to install this module. I tried the instructions here to install a CPAN module, but it fails trying to install App::cpanminus (the very first step.) I tried just running cpan Config::Simple and it didn't work either. In both situations, it fails with this error message:
Unwrapping had some problem, won't try again without force
Had problems unarchiving. Please build manually
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Does CPAN just not work from the version of Perl that's installed with XAMPP? If so, how do I upgrade it without breaking anything?
manually download and unpack the distro archive
change into the unpacked directory
run cpanm . or cpan .
XAMPP also ships with PPM in C:\xampp\perl\bin\ppm.bat which is often a more Windows friendly way to get modules for perl.
There's a step by step example of using ppm with XAMPP here: http://www.apachefriends.org/f/viewtopic.php?t=26407
Many modules are already installed in C:\xampp\perl\lib and C:\xampp\perl\site\lib

How to install scons on Mac OS X

Can you please tell me how can I install scons on MacOSX?
I don't see a mac specified download from http://www.scons.org/
Thank you.
An alternative to MacPorts would be to use HomeBrew, where you'd just to
brew install scons
Download the tarball and then refer to the first chapter of the user guide, Building and Installing SCons. In short:
# cd scons-1.2.0
# python setup.py install
Install MacPorts, then at the Terminal (Applications > Utilities > Terminal.app), type:
sudo port install scons
This command will automatically download and install scons for you. MacPorts requires that you have the developer tools installed, so if you don't, you will need to download and install the Xcode 3 DVD.
NOTE 1: Xcode 2.5 is the last version of Xcode that will work on Mac OS X Tiger.
NOTE 2: This may seem awfully painful if you don't already have MacPorts installed. However, you really should go this route, as MacPorts makes it easy to update installed software, it automatically manages dependencies between software, and it makes it easier to install other packages in the future.
If you have the Python setuptools, the following will install scons-1.2.0 from sourceforge:
easy_install scons
But bear in mind the issues people raise with setuptools.
Also, keep in mind this question and the answers about virtualenv and pip for isolating Python environments.
There is also a GUI installer for SCons on Mac OS X that I wrote available for download here:
https://github.com/rviney/scons-mac-installer
Since version 2.3.0 SCons should work without installing:
# get the source and switch to stable 2.3.0 version
hg clone https://bitbucket.org/scons/scons/ -r 2.3.0
# make sure to use Python 2 for now
python scons/src/scripts/scons.py
When running 2.3.0 from source, the SCons.__version__ is not set correctly, so EnsureSConsVersion() will likely to fail if that's ok for you.
pull down SCons source and put it in /Library/Python/X.X/. Make sure you have the dir structure like this: /Library/Python/X.X/SCons/init.py
remember, import searches for modules, and /Library/Python/XXX is by default in the search path.

Resources