Installing pyodbc for Python 3.3 on windows (can't use pip)? - sql-server

I'm trying to connect to the Microsoft SQL server.
I'm using python code to do so, and I want to download pyodbc.
I go to the Python33 directory by doing this: cd C:\Python33\, and I try typing in pip install pyodbc, but it doesn't recognize pip.
Did anyone else have this problem with Python 3.3?
I'm also trying to do this:
C:\Python34\Scripts>pip install pyodbc
But it says: "The system cannot find the path specified."

Pip is a stand-alone tool, you will have to install that as well in 3.3. Here is a link on a really good explanation:
(How do I install pip on Windows?)
In 3.4, pip was included, but you will have to call it with
python -m pip
inside your scripts directory

Related

PECL installation conflict isssue

I am trying to install Pear package using following command
sudo yum install php-dev php-pear
But it's giving me following error:
Transaction check error:
file /usr/bin/php from install of php-cli-5.4.16-48.el7.x86_64 conflicts with file from package ea-php-cli-1.0.0-9.13.1.cpanel.x86_64
I am installing this package for sqlsrv driver but I am not able to do.
It seems you using WHM/cpanel right? Don't install extensions using CLI. You can install it using PECL installer in WHM dashboard.
here the screenshot of PECL module installer
But if the module is not available on the GUI installer, you can install the module using built-in PHP from the cPanel. the path of pecl executable is /usr/bin/ea-phpVERSION-pecl.
an example if you want to install sqlsrv on php 7.3:
/usr/bin/ea-php73-pecl install pdo_sqlsrv
reference: https://support.cpanel.net/hc/en-us/articles/360053132353-How-install-pdo-sqlsrv-to-connect-to-MSSQL-Servers

amazon-sagemaker-lab:: libXrender.so.1 package

I am trying to use the amazon sagemaker lab environment and the package libXrender is not installed.
sudo privileges are removed and it's not possible to install it with:
apt-get install libxrender1
Is there an easy fix or do I have to contact their support to install the package in their docker container?
Thanks in advance!
Error results from this piece of code:
from rdkit.Chem.Draw import rdMolDraw2D
from rdkit.Chem.Draw.rdMolDraw2D import *
ImportError: libXrender.so.1: cannot open shared object file: No such file or directory
No problem in installing rdkit. The problem crops up when trying to call one of its visualisation functions rdkit.Chem.Draw.rdMolDraw2D - MolDraw2D requires the help of a rendering library to display the molecules in 2D.
Yes, sudo privileges are not available in Studio Lab. Your best bet is to find a different library that you can install without sudo privileges.
You can also try - conda install -c conda-forge rdki
If you want to use rdkit, we can install it by conda install -c conda-forge rdkit in Studio Lab.

How to interact with mssql from python?

How to interact with mssql from python? I realy nead it to write my site.
I tried pyodbc
(
pip install pyodbc
)
but cmd says there is an error in setup.py.
Pleese, help me!
P.S. I am using windows and mssql.
[Updated Answer]
Follow these steps to install pyodbc and pymssql in 64-bit Windows with *Python 3.**
Update pip tool: python -m pip install pip -U
Update python setuptools : python -m pip install setuptools -U
Install pyodb : pip3 install pyodbc -U
Download and install MS Visual C++ 14.0 Build Tools. It's required for installing pymssql.
double click on downloaded file and select Workloads → Visual C++ build tools then in optional features tab select Windows 10 SDK(windows 8 user select Windows 8 SDK) and install.
Install pymssql: pip3 install pymssql -U
[Old Answer]
One can also try these unofficial wheel files, if above method doesn't work.
You can install the same using the unofficial pyodbc wheel for python 3.* from here, just download the appropriate wheel (*.whl) file form this link and install it using
pip install **downloaded_wheel_file_name**.whl
Note: Don't forget to change the downloaded_wheel_file_name with your downloaded wheel file's name.
You need to have Microsoft ODBC driver for sql in Windows to make
pip install pyodbc
work.
Try to follow this link and install required drivers.
Try this #Kostya2007: pip install --allow-external pyodbc --allow-unverified pyodbc pyodbc
or
pip install https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pyodbc/pyodbc-3.0.7.zip
depending on your Python version
or
easy_install pyodbc-3.0.7.win32-py2.7.exe

error: import pychart , during install source code odoo 9.0

I wrote so many thing in requirements.txt and reinstalled but it didn't work out. I installed odoo 9.0 source code for windows. The command prompt is showing error:
from pychart import *
What do I need to write in requirements.txt for pychart?
As i just ran into the same problem unrelated to odoo.
The following command solved it for me:
pip install Python-Chart
To install the python packages for odoo you can use below command found from this detailed odoo install guide
cd /tmp && wget https://raw.githubusercontent.com/odoo/odoo/9.0/requirements.txt && sudo pip install -r requirements.txt
It will install all the python dependacy in just one command.
Hope this helps.
You have to install that package before you use that, If are on ubuntu command is pip install pychart and if you are on windows the command is c:\Python27\Scripts\pip.exe install pychart.I assume you have installed python on default folder c drive.
Why don't you create a module like install_module and on depends you can add required list of module to install. If you install that module it'll automatically install all depended module. I'm using this same. Instead of command prompt it'll be quite easy too. You can view the depends module list in Technical Data of that install_modules.
I Hope it'll be helpful.

CakePHP 3.0 installation: intl extension missing from system

Using the CakePHP docs, I am trying to install 3.0-beta2 using composer but I got this error:
cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system
However, I know for sure that intl is installed (it shows on phpinfo). I'm using PHP 5.4.33/Apache 2.4.10.1
I faced the same problem today. You need to enable the intl PHP extension in your PHP configuration (.ini).
Solution Xampp (Windows)
Open /xampp/php/php.ini
Change ;extension=php_intl.dll to extension=php_intl.dll (remove the semicolon)
Copy all the /xampp/php/ic*.dll files to /xampp/apache/bin
Restart apache in the Xampp control panel
Solution Linux (thanks to Annamalai Somasundaram)
Install the php5-intl extension sudo apt-get install php5-intl
1.1. Alternatively use sudo yum install php5-intl if you are on CentOS or Fedora.
Restart apache sudo service apache2 restart
Solution Mac/OSX (homebrew) (thanks to deizel)
Install the php5-intl extension brew install php56-intl
If you get No available formula for php56-intl follow these instructions.
Restart apache sudo apachectl restart
Eventually you can run composer install to check if it's working. It will give an error if it's not.
I faced the same issue in ubuntu 12.04
Installed: sudo apt-get install php5-intl
Restarted the Apache: sudo service apache2 restart
OS X Homebrew (May 2015):
The intl extension has been removed from the main php5x formulas, so you no longer compile with the --enable-intl flag.
If you can't find the new package:
$ brew install php56-intl
Error: No available formula for php56-intl
Follow these instructions: https://github.com/Homebrew/homebrew-php/issues/1701
$ brew install php56-intl
==> Installing php56-intl from homebrew/homebrew-php
When using MAMP
1 Go to terminal
vim ~/.bash_profile
i
export PATH=/Applications/MAMP/bin/php/php5.6.2/bin:$PATH
Change php5.6.2 to the php version you use with MAMP
Hit ESC,
Type :wq,
hit Enter
source ~/.bash_profile
which php
2 Install Mac Ports
https://www.macports.org/install.php
sudo port install php5-intl OR sudo port install php53-intl
cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/
{take a good look at the folder names that u use the right ones}
3 Add extension
Now, add the extension to your php.ini file:
extension=intl.so
Usefull Link:
https://gist.github.com/irazasyed/5987693
The error message clearly states what the problem is. You need the intl extension installed.
Step 1: install PHP intl you comfortable version
$sudo apt-get install php-intl
step 2:
For XAMPP Server intl extension is already installed, you need to enable this extension to uncomment below the line in your php.ini file. Php.ini file is located at c:\xampp\php\php.ini or where you have installed XAMPP.
Before uncomment:
;extension=php_intl.dll ;extension=php_mbstring.dll
After uncommenting:
extension=php_intl.dll extension=php_mbstring.dll
Short answer: activate intl extension in php_cli.ini. Thanks to #ndm for his input.
If you are using latest version Ubuntu 16.04 or later just do
sudo apt-get install php-intl
Then restart your apache
sudo service apache2 restart
In my case I was not actually trying to run cakephp locally, I was just trying to get it to auto update locally using composer (because I am playing with writing plugins that you install with composer). Since I don't actually even run it locally I could simply ignore requirements by adding the --ignore-platform-reqs flag.
php composer.phar update --ignore-platform-reqs
In my case, my running php version is 7.1.x on mac OSX .
I installed intl command using brew install php71-intl.
Placing extension=intl.so inside php.ini was no effect at all. Finally i looked for extension installed directory and there i saw intl.so and placed that path (extension=/usr/local/Cellar/php71-intl/7.1.11_20/intl.so) to my php.ini file and it solved my problem.
In my case (xampp PHP 8.0)
Find ;extension=intl in /xampp/php/php.ini
Remove ; and Restart Apache
MAKE this
In XAMPP, intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.
In WAMP, the intl extension is “activated” by default but not working. To make it work you have to go to php folder (by default) C:\wamp\bin\php\php{version}, copy all the files that looks like icu*.dll and paste them into the apache bin directory C:\wamp\bin\apache\apache{version}\bin. Then restart all services and it should be OK.
if you use XAMPP do this
1. turn off XAMPP
2. Modifed the php.ini is located in c/:xampp/php/php.ini
3. intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.
For Ubuntu terminal:
Please follow the steps:
Step-1:
cd ~
Step -2: Run the following commands
sudo apt-get install php5-intl
Step -3: You then need to restart Apache
sudo service apache2 restart
For Windows(XAMPP) :
Find the Php.ini file:
/xampp/php/php.ini
Update the php.ini file with remove (;) semi colon like mentioned below:
;extension=php_intl.dll to extension=php_intl.dll
and save the php.ini file.
After that you need to
Restart the xampp using xampp control.
Intl Means :Internationalization extension which enables programmers to perform UCA-conformant collation and number,currency,date,time formatting in PHP scripts.
To enable PHP Intl with PECL can be used.
pecl install intl
On a plain RHEL/CentOS/Fedora, PHP Intl can be install using yum
yum install php-intl
On Ubuntu, PHP Intl can be install using apt-get
apt-get install php5-intl
Restart Apache service for the changes to take effect.
That's it
For those who get Package not found error try sudo apt-get install php7-intl then run composer install in your project directory.
I had the same problem in windows
The error was that I had installed several versions of PHP and the Environment Variables were routing to wrong Path of php see image example
I'm using Mac OS High Sierra and none of these worked for me. But after searching a lot I found one that worked!
This may seem trivial, but in fact about 2 months ago some clever guys made changes in brew repository, so doing just: brew install php71-intl will show you error with message that such recipe doesn’t exists.
Fortunately, there is. There is temporary fix in another brew repo, so all you have to do is:
brew tap kyslik/homebrew-php
brew install kyslik/php/php71-intl
SOURCE: http://blastar.biz/2018/04/14/how-to-enable-php-intl-extension-for-php-7-1-using-xampp-on-macos-high-sierra/
I use Linux Ubuntu 20, you can try this:
Check php installed modules:
php -m | grep intl
If there are no result(s) from this command, you should just go ahead and install the module:
sudo apt-get install php7.4-intl
you will need to change *php7.4 to your desired php version.
you should restart apache when you're done:
sudo service apache2 restart

Resources