wxPython Installation failure - ubuntu-18.04

I am trying to install wxPython on a new installation of Ubuntu 18.04 using the command
pip3 install wxPython
The build fails with
error: [Errno 2] No such file or directory: 'build/lib.linux-x86_64-3.6/wx/libwx_baseu-3.0.so'
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-30uqzd2e/wxPython/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-hynl659w-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-30uqzd2e/wxPython/
I have no idea where to look for a solution. Can someone please suggest where I might start
[EDIT 20200424 08:06]
I looked in
/usr/lib/x86_64-linux-gnu/
and
libwx_baseu-3.0.so.0
was absent. I have installed it from this site
It is now present, but the install fails with the same message

I have managed to install wxPython.
I reinstalled Ubuntu 18.04 and performed the following:
sudo apt install make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev
pip3 install wxpython
I guess that when it was failing I had tried many fixes and somewhere along the line something was corrupted or there was a mismatch somewhere.
My solution was based on this answer

I Installed wx.python 4.1.0 yesterday with:
URL=https://extras.wxpython.org/wxPython4/extras/linux/gtk2/ubuntu-18.04
pip install -U -f $URL wxPython
See: https://extras.wxpython.org/wxPython4/extras/ for details.
For gtk3 simply replace gtk2 in the url above.

Related

How to install ROS on Ubuntu 18.04?

Im running Ubuntu 18.04 and trying to install ROS for the first time on my machine. I have tried to follow the instructions at: http://wiki.ros.org/melodic/Installation/Ubuntu
I get stuck at this part.
sudo apt-get install ros-melodic-desktop-full
My attempts:
sudo apt -f install
sudo apt update --fix-missing
sudo dpkg --configure -a
sudo dpkg --remove --force-remove--reinstreq
sudo apt clean
sudo apt update
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
Nothing has worked so far.
Terminal commands:
$sudo apt-get install ros-melodic-desktop-full
Reading package lists… Finished
Builds dependency trees
Reading state information ... Finished
Some packages could not be installed. It may mean that you have requested
an impossible situation or, if you use the unstable distribution
that some necessary packages have not yet been created or moved
from "Incoming".
The following information may help to resolve the situation:
The following packages have dependencies that cannot be satisfied:
rose-melodic-desktop-full: Dependent on: rose-melodic-desktop but it will not be installed
Depending on: rose-melodic-perception but it will not be installed
Depending on: rose-melodic-simulators but it will not be installed
Depending on: ros-melodic-urdf-sim-tutorial but it will not be installed
E: Could not correct the problems, you have withheld broken packages.
Please help me install ROS
1 - After following ROS melodic Installation first steps (see link below), Try to install it with the link "click here" below the "sudo apt install ros-melodic-desktop-full" line
ROS melodic Installation page
If it's doesn't work
2 - check, "Software & Update" parameters
(if you cannot find it: launch "Ubuntu Software Center" and in the menu bar, on top, select "Software & Update")
In "Other Sofware" tab, the link
"http://pacckage.ros.org/ros/ubuntu bionic main"
is printed, and in "Autentication" tab a key from Open Robotics is printed
3 - Try to do 1- again, if it doesn't work, follow 4-
4 - In "Updates" tab, check "recommanded Updates", launch "Update Manager" and install updates (I don't do it properly on my PC)
5 - And finally you need to install manually rosdep with:
"sudo apt-get install python-rosdep"
Ubuntu (apt) does NOT allow packages with the same name but different versions to be installed.
Remove other versions first. For example: apt remove ros-desktop*
first of all install program on ubuntu.
sudo apt-get update
sudo apt-get upgrade
after update packet try follow the instructions at: enter link description here again
I got it working like so:
Install deps:
sudo apt install gazebo9-common libgazebo9-dev gazebo9 ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-dev ros-melodic-gazebo-ros-control ros-melodic-gazebo-ros ros-melodic-urdf-sim-tutorial ros-melodic-simulators
Install ros melodic
sudo apt-get install ros-melodic-desktop-full

Apache start libphp7.3.so not found

I have Install php 7.3 and apache2 but when I try to start apache2 , I have this error :
service apache2 start
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.3.load: Cannot load /usr/lib/apache2/modules/libphp7.3.so into server: /usr/lib/apache2/modules/libphp7.3.so: cannot open shared object file: No such file or directory
I really don't know how to resolve this problem, I have tried to remove and reinstall without success.
You're getting that error because the PHP 7.3 library for Apache is not installed.
sudo apt install -y libapache2-mod-php7.3
The above command should fix it.
It solved my problem:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.3
sudo apt-get install php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-mysql php7.3-mbstring php7.3-zip php7.3-fpm php7.3-intl php7.3-simplexml
sudo service apache2 restart
For me the problem was that I did not install apache tools for php.
On arch linux:
yaourt -S php-apache
After that, module appeared in the folder.
The best way not to make a mistake is to follow guide: https://wiki.archlinux.org/title/Apache_HTTP_Server#PHP

wxHaskell not find module `Distribution.Compat.Exception'

I am trying install wxhaskell on ubuntu
(and I have already installed wxwidget and it works well in codeblock)
I run cabal install wxc in terminal
and here is output
/tmp/wxc-0.92.1.1-2711/wxc-0.92.1.1/Setup.hs:25:8:
Could not find module Distribution.Compat.Exception
It is a member of the hidden package Cabal-1.22.5.0.
it is a hidden module in the package Cabal-1.16.0
Use -v to see a list of the files searched for.
Failed to install wxc-0.92.1.1
cabal: Error: some packages failed to install:
wxc-0.92.1.1 failed during the configure step. The exception was:
ExitFailure 1
actually, I can find Distribution.Compat.Exception
and I tried sudo ghc-pkg expose Cabal-1.16.0
sudo ghc-pkg expose Cabal-1.22.5.0 but nothing changed
someone help me out, great thanks!
If you are using ubuntu I think I have a solution. If you install GHC in ubuntu via "apt-get install ghc", all ghc packages are installed in /usr/lib/ghc/xyz. If you have installed ghc manually, not with a package manager, I don't know a solution.
Try this:
sudo cabal install cabal-install --global
Then do all the wxHaskell specific cabal installs the same way. So:
sudo cabal install wxdirect --global
sudo cabal install wxc --global
...
If this doesn't work, try this:
rm -rf ~/.ghc

Install rst2man failed for varnish agent [fix]

I'm trying install varnish agent on ubuntu server using virtual box. There is a message in the middle installation process that say "you need rst2man installed to make dist".
When I tried install rst2man using "sudo apt-get install rst2man" another message come in :
Reading package list....done
Building dependecy tree
Reading state information....done
E: unable to locate package rst2man
"unable to locate package rst2man" what does it mean ? anyone know ? please help.
Problem fix:
I tried to install python-docutils for the rst2man.
rst2man is a virtual package, then you need install python-docutils package than provide rst2man and utilities for the documentation of Python modules.
sudo apt-get install python-docutils
After install this package, try the command:
sudo which rst2man
python-docutils wasn't working for me
I had to install the package docutils-common
sudo apt-get install docutils-common
In case if you installing varnish-agent-2 - after
sudo apt-get install python-docutils
you should execute again
./configure
Working on CentOS and likely RHEL as well:
yum install python-docutils

Can't install xdebug on Mac with Homebrew

I'm kind of new to using Homebrew, but I love it. It's so easy. I'm trying install Xdebug. Some of the posts on the web say to do this:
brew install xdebug
But it doesn't work. I get: Error, no available formula.
I did brew search xdebug and it returned:
josegonzalez/php/php53-xdebug josegonzalez/php/php54-xdebug
I tried several different iterations of brew install with this including brew install php53-xdebug, but still no luck. Can someone help me? I can't find anything on Xdebug's site about using Homebrew, but yet posts on the web seem to indicate it's possible.
// Working as of 2023
As homebrew removed the extra php repository containing a version with xdebug already installed, you have to install it manually.
Summary
brew install <php version> for php
update your path
pecl install xdebug for xdebug
Full step-by-step example
# update homebrew
brew update
# install a version of php, e.g. 7.0
brew install php#7.0
# now they tell you how to link it, in my case
echo 'export PATH="/usr/local/opt/php#7.0/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php#7.0/sbin:$PATH"' >> ~/.bash_profile
# reload the file with the updated path, so we can use pecl
source ~/.bash_profile
# check that the path is to the correct php executable,
# and pecl is available
which pecl
# returns: /usr/local/opt/php#7.0/bin/pecl
# install xdebug, see https://xdebug.org/docs/install#pecl
pecl install xdebug
# check that everything worked
php --version
# should show a xdebug version
# like: with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
The pecl install xdebug step above ended with
Build process completed successfully
Installing '/usr/local/Cellar/php#7.0/7.0.30/pecl/20151012/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.6.0
Extension xdebug enabled in php.ini
So I didn't even need to enable the xdebug.so in php.ini.
If you need a special version of xdebug (e.g. your IDE doesn't like the 3.x.x versions), you can install a specific version xdebug-$VERSION, e.g. pecl install xdebug-2.9.8.
You can find them on the list of available versions (Thanks Bower)
Add this repository: https://github.com/josegonzalez/homebrew-php#readme
Then use brew install php54-xdebug for PHP 5.4
Or brew install php53-xdebug for PHP 5.3
Or brew install php55-xdebug for PHP 5.5
Forget about homebrew for a moment. I have tried doing with it and it is not a that good idea stability-wise. Instead stick to the default installation guide:
Installing XDebug on Mac OSX
Go to http://xdebug.org/wizard.php and paste your phpinfo() content
there.
Download xdebug-2.2.5.tgz (http://xdebug.org/files/xdebug-2.2.5.tgz)
Unpack the downloaded file with:
tar -xvzf xdebug-2.2.5.tgz
Run:
cd xdebug-2.2.5
Run phpize (install it via homebrew if you don't have it already)
phpize
As part of its output it should show (If it does not, you are using the wrong phpize):
Configuring for: ...
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Run:
./configure
Run:
make
Run:
cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20100525
Edit /etc/php.ini and add the line:
zend_extension =
/usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so
Restart the web server by typing in the terminal:
sudo apachectl restart
Updated: 09-10-2019
For PHP 5.6 & 7.0 (not anymore in brew core)
brew tap exolnet/homebrew-deprecated
Use brew bundled pecl (when php installed with brew)
PHP 5.6 example
brew install php#5.6
$(brew --prefix php#5.6)/bin/pecl install --force xdebug-2.5.5
PHP 7.0 example
brew install php#7.0
$(brew --prefix php#7.0)/bin/pecl install --force xdebug
PHP 7.1 example
brew install php#7.1
$(brew --prefix php#7.1)/bin/pecl install --force xdebug
PHP 7.2 example
brew install php#7.2
$(brew --prefix php#7.2)/bin/pecl install --force xdebug
PHP 7.3 example
brew install php#7.3
$(brew --prefix php#7.3)/bin/pecl install --force xdebug
or link with brew first
PHP 5.6 example
brew install php#5.6
brew link --force php#5.6
pecl install --force xdebug-2.5.5
brew unlink php#5.6
PHP 7.0 example
brew link --force php#7.0
pecl install --force xdebug
brew unlink php#7.0
PHP 7.1 example
brew link --force php#7.1
pecl install --force xdebug
brew unlink php#7.1
PHP 7.2 example
brew link --force php#7.2
pecl install --force xdebug
brew unlink php#7.2
PHP 7.3 example
brew link --force php#7.3
pecl install --force xdebug
brew unlink php#7.3
If php -v gives you an error stating xdebug.so could not be found (assuming the pecl install went well) then you could have "old" settings like php.ini Un-/reinstalling php with brew does not remove ini files. Upgrading php to the new format does not update ini files. Just reinstall php with brew after you removed the folder /usr/local/etc/php/5.6/ and xdebug should work.
The new brew php installation does not link. You could do that yourself if you would like to (brew link --force php#5.6) Als you could install brew-php-switcher to switch between versions.
brew install brew-php-switcher
brew-php-switcher 5.6 -s
php -v
brew-php-switcher 7.0 -s
php -v
Keep in mind if you loaded php as a service you have to restart the service.
brew services restart php#7.0
I'd found this page while googling how to install xdebug for php 7.1 on osx, and I've decided to leave here my solution:
brew install homebrew/php/php71-xdebug
Maybe it'll be helpful for someone else in future...
Xdebug on Big Sur for php8
php8 previously installed with brew.
~ % pecl install xdebug
ERROR: `phpize' failed
Ouch! Check xcrun. Thank you Louis Charette:
~ % xcrun --show-sdk-path
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error. Update Xcode. I just installed, and retest:
~ % xcode-select --install
xcode-select: note: install requested for command line developer tools
~ % xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
That's better! Now go back and try pecl again:
~ % pecl install xdebug
...
Build process completed successfully
Installing '/usr/local/Cellar/php/8.0.0_1/pecl/20200930/xdebug.so'
install ok: channel://pecl.php.net/xdebug-3.0.2
Extension xdebug enabled in php.ini
And check it worked:
~ % php -v
PHP 8.0.0 (cli) (built: Nov 30 2020 13:51:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies
This is my solution! Try it! ;)
1 Install developer tools:
xcode-select --install
2 Instal Autoconf. This is a tool for producing shell scripts that automatically configure software
brew install autoconf
3 If you use PHP >5.6
sudo pecl install xdebug
Have fun ;)
Catalina
Starting with Catalina (Mac OS 10.15) PHP seems to be pre-installed (check with php -v) It could be installed along xcode or another software (I'm not sure) But I just installed Catalina yesterday and haven't installed Homebrew yet, Also xdebug is available too. I just had to rename /etc/php.ini.default and add this line
zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
macOS 10.14 Mojave, Homebrew, PHP 7.3, April 2020
The description given in the following article was the only thing I could get to work on macOS 10.14 Mojave with Homebrew to install PHP 7.3 with working xdebug:
brew list | grep php | awk '{ print "brew uninstall --force "$1}' | bash # Remove any old version of php.
rm -rf /usr/local/Cellar/php # To be sure, manually remove the php cellar folder.
brew untap homebrew/php # Then clean any php tap (extra repo).
brew cleanup # Cleanup and Update your brew.
brew update
brew install php # Install the latest version of php.
pecl uninstall xdebug # Clean up old xdebug.
pecl install xdebug-beta # Install the latest version of xdebug-beta (The xdebug is not compatible with 7.3 so you need to use the xdebug-beta).
php -v # Should now say "with Xdebug v2.9.4, Copyright (c) 2002-2020, by Derick Rethans"
It looks like the repo moved, but it is available here, complete with instructions on how to access it from Homebrew.
If you get this error after adding the tap and installing:
$ brew install "josegonzalez/php/php55"
==> Installing php55 from josegonzalez/php
Error: Formulae found in multiple taps:
* homebrew/php/php53
* josegonzalez/php/php53
Please use the fully-qualified name e.g. homebrew/php/php53 to refer the formula.
it is because josegonzalez/php has been moved to homebrew-php/php recently, so you will face the previous error.
The idea is pretty simple, remove the old deprecated repo josegonzalez/php
brew untap josegonzalez/php
brew tap --repair
brew update
See the source of this solution to fix any other related bugs.
It helped me to solve zend version and xdebug
Xdebug requires Zend Engine API version 320160303.
The Zend Engine API version 320180731 which is installed, is newer.
https://xdebug.org/wizard.php
As at May 2021, after installing PHP via Homebrew just run this:
pecl install xdebug
You'll need XCode installed as above answers have indicated.
The other answers involving other brew repositories or php74-* package namespaces are based on the old way Homebrew worked with PHP.
Improved Answer for MacOS
If you have followed the instructions written on the official docs and cannot see XDebug info using php -v command and instead getting errors, the last step you should do is the following:
Go to the 99-xdebug.ini file you made in the described path and add this line:
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so"
(still errors? check your xdebug.so path if it is valid)
After saving the changes, restart php using the command below:
brew services restart php#7.3 (change 7.3 with your php version)
Then check if you can now see XDebug info using php -v command.
NOTE: "Described path" for 99-xdebug.ini is something like:
/usr/local/etc/php/7.3/conf.d (change 7.3 with your php version)
To be sure, type php --ini command.

Resources