Properly install pyodbc - python

All I want to do is install pyodbc. I am using python 3.4.4 and I can verify the installation is not correct since running import pyodbc causes the error ImportError: No module named 'pyodbc'. In my /Python/Scripts directory I have tried multiple times running pip install pyodbc which gives Requirement already satisfied (use --upgrade to upgrade): pyodbc in c:\python34\
lib\site-packages and after searching I believe that means it has already been installed.
Additionally I tried downloading the .whl file and installing it as pip install pyodbc-4.0.17-cp34-cp34m-win_amd64.whl which gives pyodbc-4.0.17-cp34-cp34m-win_amd64.whl is not a supported wheel on this platform.
What am I not doing that I need to do in order to get it installed properly?

Related

ImportError: No module named requests tried to install requests modeule but it's already fullfilled by other python version

I tried to run a python script but had the error
ImportError: No module named requests
Tried to install module called requests but got another error
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
I can't troubleshoot it any more already wasted 3 days to find the solution.
Your pip uses python3. This is what the path here says:
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
^
But you run your script with python2. The output of python --version proves this.
Execute your script with python3 48506.py and it should work.
Otherwise check your pip version pip -V. The python version should match with python -V.
It's generally recommended to use python -m pip. This ensures that you use the same python version for pip as for your script.

pip installing in usr/lib/python3.6/site-packages instead of virtualenv on ubuntu server

I'm having a problem when installing packages on my virtualenv.It all started when I upgraded my pip to the latest version. I tried to revert my pip version to where I find it stable. When I try to install, for example, django-tables2, it says:
Requirement already satisfied: django-tables2 in /usr/lib/python3.6/site-packages (2.3.1)
Requirement already satisfied: Django>=1.11 in /usr/local/lib/python3.6/dist-packages (from django-tables2) (2.2.4)
Requirement already satisfied: pytz in /usr/local/lib/python3.6/dist-packages (from Django>=1.11->django-tables2) (2019.2)
Requirement already satisfied: sqlparse in /usr/local/lib/python3.6/dist-packages (from Django>=1.11->django-tables2) (0.3.0)
WARNING: You are using pip version 19.3.1; however, version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
But when I check my folder in my virtualenv, it doesn't show there. I tried some commands like which pip and which pip3 and it says this:
(unidaenv) root#UnidaWebApplication:/home/unidaweb/unidaproject# which pip
/home/unidaweb/unidaproject/unidaenv/bin/pip
(unidaenv) root#UnidaWebApplication:/home/unidaweb/unidaproject# which pip3
/home/unidaweb/unidaproject/unidaenv/bin/pip3
(unidaenv) root#UnidaWebApplication:/home/unidaweb/unidaproject#
I also tried pip list but I can't find the package that I installed to my virtualenv.
I'm getting a bad gateway error when I try to add it on my settings.py, I don't really know how to fix this but when I'm in the version of pip that I know was stable running my project, I don't get this error and I can install any package that I needed to my project. Any help would be much appreciated. I'm stuck on this for about a week, hoping that someone could help me with this issue.
virtualenvs can break occasionally especially if the somebody updated the python executable the virtualenv was based or some packages / shared libraries of it.
I'd suggest to try out with a new virtualenv. (delete the broken one and replace it)
Further.
for debugging I suggest to type following two commands:
type -a python and type -a pip
In case your search path has some hidden surprises it could be safer to call
python -m pip instead of python though in a properly setup virtualenv it shouldn't make a difference.

Error in installing python package Flair, about a dependent package not hosted in PyPI

I am trying to install flair. It is throwing below error when executing below command:
pip install flair
ERROR: Packages installed from PyPI cannot depend on packages which are not also hosted on PyPI.
tiny-tokenizer depends on SudachiDict_core# https://object-storage.tyo2.conoha.io/v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190927.tar.gz
I thought installing this package explicitly might fix the error but it doesn't. The error remains same.
The installed version of SudachiDict-core is below:
SudachiDict-core 0.0.0
Below is the Environment:
OS: Windows 10
Python: 3.6 (64 bit)
Any hint is appreciated. Thank you!
Note:
First hurdle when installing flair was torch package. It was resolved simply when torch package is installed. The error looked like below:
ERROR: Could not find a version that satisfies the requirement torch>=1.1.0 (from flair) (from verERROR: No matching distribution found for torch>=1.1.0 (from flair)
You can try
pip install --upgrade git+https://github.com/zalandoresearch/flair.git
Source: https://github.com/flairNLP/flair/issues/1327#issuecomment-571639994
Or
to install separately:
pip install tiny-tokenizer
After this run:
pip install flair
It is strange running below command solved the problem.
pip install flair==0.4.3
I assume that the problem is in a latest version 0.4.4 (and its dependencies).
Note: I had torch==1.1.0 package already installed.

Having issues with Teradatasql python

I would like to connect to the Teradata server and I am using the following code:
Import teradata
Import teradatasql
Con=teradata.connect( connection string)
I have downloaded the teradatasql whl file and used the following command to install it:
Pip install teradatasql-16.20.0.39-py3-none-any.whl
I am getting the following error:
Could not find a version that satisfies the requirement pycryptodome
I have also downloaded a pyroptosomeme but it is not installing
I appreciate your help
We recommend that you download and install from pypi directly:
pip install teradatasql
When you install directly from pypi then pip install automatically downloads and installs any required prerequisite packages such as pycryptodome.

How to change MySQL Connector installation directory?

I am trying to Install MySQL Connector using "pip install mysql-connector-python" but it says that
Requirement already satisfied (use --upgrade to upgrade): mysql-connector-python in /Library/Python/2.7/site-packages
I am using Python IDLE and i want to somehow install mysql-connector in IDLE`s modules directory and so MySQLdb.
How do i change the default directory which is /Library/Python/2.7/site-packages to the one used by IDLE?
You best use virtualenv, and make IDLE work in a virtual environment. This way you can just install Connector/Python as usual.
Or you can install MySQL Connector/Python in a different folder and add it to the PYTHONPATH when launching IDLE:
shell> pip install --target=/tmp/myconnpy --allow-external mysql-connector-python mysql-connector-python
shell> PYTHONPATH="/tmp/myconnpy" idle
pip 1.4.1 has apparently problems using --target when the package is already installed system-wide, even using --ignore-installed. So you'll need to remove the package first first.

Categories

Resources