Instaling pyodbc on linux - pyodbc

On RHEL trying to install pyodbc getting below error:
InstallationError: Command /usr/bin/python -c "import setuptools,
tokenize;file='/tmp/pip-build-q948yR/pyodbc/setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record /tmp/pip-Fdkc1f-record/install-record.txt
--single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-q948yR/pyodbc

You need to install a pre-requisite package to built pyodbc. On RHEL:
sudo yum install unixODBC-devel
If you're connecting to SQL Server, don't forget FreeTDS:
sudo yum install freetds-devel
Good luck!

Related

obfsproxy running on centos 7

I am using CentOS 7 os.
I installed python3.6 on this machine.
pip3 is latest version 21.
After that i installed obfsproxy like this :
To use obfsproxy you will need Python (>= 2.7) and pip.
pip3 install pathlib
pip3 install pyopenssl
pip3 install Twisted
pip3 install obfsproxy
Here are installation path :
/usr/local/lib/python3.6/site-packages/obfsproxy-0.2.13-py3.6.egg-info
/usr/local/lib/python3.6/site-packages/obfsproxy
/usr/local/lib/python3.6/site-packages/obfsproxy/pyobfsproxy.py
/usr/local/bin/obfsproxy
Now after running obfsproxy command i got this error :
Traceback (most recent call last):
File "/usr/local/bin/obfsproxy", line 11, in <module>
load_entry_point('obfsproxy==0.2.13', 'console_scripts', 'obfsproxy')()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
return ep.load()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
return self.resolve()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python3.6/site-packages/obfsproxy/pyobfsproxy.py", line 183
except ValueError, err:
^
SyntaxError: invalid syntax
[root#blobloblo ~]# obfsproxysite-packages/pkg_resources/__init__.py", line 476, in load_entry_point
What version of python is suitable for this script and how can i fix this error?
I tried some older python versions.
Buy manual installation has some error and this is better to install python3 from default repository.
Mean for install python3 i did this :
centos is updated totally.
sudo yum install -y epel-release
sudo yum install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
sudo yum -y groupinstall "Development Tools"
gcc --version
openssl version
openssl version -d
sudo yum install -y openssl-devel libyaml-devel libffi-devel bzip2-devel
sudo yum install -y make automake gcc glibc
sudo yum install -y gcc
python -V
python --version
python2 -V
python3 -V
sudo yum install python3
python3 -m pip install --upgrade pip
Here is https://pypi.org/project/obfsproxy/ link.

error installing "rgl" package, version 0.100.19 in anaconda/jupyter-notebook. Ubuntu 18.04

I like to install "rgl" package version 0.100.19 (since the other package depends on this version) in anaconda/jupyter notebook environment and received error.
configure: error: X11 not found but required, configure aborted
I tried
sudo apt-get install xorg
sudo apt-get install libx11-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install r-cran-rgl
conda install -c conda-forge xorg-libx11
conda install -c anaconda mesa
but, they did not help yet.
install.packages("rgl")
configure: error: X11 not found but required, configure aborted
I came across this problem, my solution was to:
$ conda install r-rgl
It seems like the conda install goes to the conda R (see this with which R), and the way I found to get rgl installed on conda's R version was via conda install.

Error when installing software in Jupyter

I am running jupyter notebooks but when trying to install software with:
!pip install ipython-sql
it returns this error:
copying build/lib.linux-x86_64-2.7/prettytable.py -> /usr/local/lib/python2.7/dist-packages
error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/prettytable.py'
And below, in red letter:
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6I8SLA/prettytable/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-nL3KsL-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-6I8SLA/prettytable/
That is all information I have. Any idea how to fix it?
I recreated your problem and solved it using:
!pip install ipython-sql --user
I use Linux Mint and Python 3.4. Using the --user flag stores libraries in your home directory, in my case under ~/.local/lib/python3.4/site-packages.

Error setting up environment on Google Cloud Shell to use Cloud ML

Following instructions from https://cloud.google.com/ml/docs/how-tos/getting-set-up:
Created a project and started the Cloud Shell.
Ran below script to Install required tools and dependencies
curl https://raw.githubusercontent.com/GoogleCloudPlatform/cloudml-samples/master/tools/setup_cloud_shell.sh | bash
Expected outcome >>
"Success! Your environment has the required tools and dependencies." when the script finishes successfully.
Actual outcome >>
+ pip install --user --upgrade 'pillow>=3.4.2' --global-option=build_ext --global-option=--disable-jpeg
/usr/local/lib/python2.7/dist-packages/pip-8.1.1- py2.7.egg/pip/commands/install.py:180: UserWarning: Disabling all use of wheels due to the use of --build-options / --g
lobal-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting pillow>=3.4.2
Using cached Pillow-4.0.0.tar.gz
Collecting olefile (from pillow>=3.4.2)
Using cached olefile-0.43.zip
Installing collected packages: olefile, pillow
Running setup.py install for olefile ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build- KwQqVS/olefile/setup.py';exec(compile(getattr(tokenize, 'op
en', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-jpeg install --record /tmp/pip-eOHYKZ-record/install-record.txt --single-vers
ion-externally-managed --compile --user --prefix=:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --disable-jpeg not recognized
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build- KwQqVS/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open) (__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-jpeg install --record /tmp/pip-eOHYKZ-record/install-record.txt --single-version- externally-managed -
-compile --user --prefix=" failed with error code 1 in /tmp/pip-build- KwQqVS/olefile/
I had the same problem and I solved it.
The error came from Pilow.
First you should install Pillow seperately: (with sudo)
sudo pip install --upgrade pillow
Then you run again the command:
curl https://raw.githubusercontent.com/GoogleCloudPlatform/cloudml-samples/master/tools/setup_cloud_shell.sh | bash
Everything will be ok.
The fix has been pushed to Github, the new version did
pip install --user --upgrade pillow,
which doesn't have the '--disable-jpeg' option. It seems that the new version of Pillow fixed the issue mentioned in Fail during installation of Pillow (Python module) in Linux and removed the option.

Cloudbees dev cloud + Capybara-webkit(Qt) how to use?

I want to run capybara-webkit in cloudbees, but I met this error in bundle
SocketCommand.h:4:19: fatal error: QObject: No such file or directory
compilation terminated.
I want to install Qt.
$ sudo apt-get install libqt4-dev
sudo: no tty present and no askpass program specified
$ apt-get install libqt4-dev
apt-get: command not found
How to install Qt? jenkins-plugin?
QT libraries are already installed on DEV#Cloud slaves,
to install capybara gem, you need to set
QMAKE=/usr/bin/qmake-qt4
then run cloudbees ruby add-on script
curl -s -o use-ruby https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/ruby/use-ruby
RUBY_VERSION=1.9.3-p327
source ./use-ruby
and setup your build script to install dependencies
gem install --conservative bundler
bundle install
(or equivalent)

Resources