Skip to content

Could not build wheels for oracledb, which is required to install pyproject.toml-based project #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
avijit09 opened this issue Dec 11, 2023 · 16 comments

Comments

@avijit09
Copy link

avijit09 commented Dec 11, 2023

I was trying to install a specific of oracledb==1.0.3 via Anaconda Prompt by running the following script

pip install oracledb==1.0.3

I have created a virtual environment where I was trying to install that specific package.

with the latest version I am getting this error "time zones are not supported in thin mode". Therefore, need to install 1.0.3

I m getting following error.,

Failed to build oracledb
ERROR: Could not build wheels for oracledb, which is required to install pyproject.toml-based projects

and

DPY-3022: named time zones are not supported in thin mode

I need to run it in thin client

Any help would be appreciated

@cjbj
Copy link
Member

cjbj commented Dec 11, 2023

You don't need/want 1.0.3. It has the same support but without the good behavior of failing gracefully with the DPY-3022. You should use the latest version and use a numeric timezone offset in Thin mode. Or use Thick mode.

@avijit09
Copy link
Author

Thanks for your reply. Tried using a numeric timezone offset in Thin mode. but still the same. Is there any other way to fix this?

@cjbj
Copy link
Member

cjbj commented Dec 12, 2023

Same what?

Share some code and your environment setup so we can help further.

@avijit09
Copy link
Author

avijit09 commented Dec 12, 2023

I tried something like this in oracle config function;

'connection_details' : {
'host':'hostname',
'port': 0000,
'service': 'servicename',
'sid':sadfsdfsdfsd5445;
'user': '',
'pass' : '',
'timezone' = '+11:00',
},

Still get the same error while trying to connect to oracledb via jupyter notebook in my anaconda environment.

DPY-3022: named time zones are not supported in thin mode.

&

Building wheel for oracledb (pyproject.toml) did not run successfully.

Unfortunately, I need to use thin mode. I just somehow need to install 1.0.3

@anthony-tuininga
Copy link
Member

You should be able to simply do pip install oracledb==1.0.3 which should download and install that particular version without needing to build it.

Please be aware, however, that versions earlier than 1.3.0 won't raise an error when a named time zone is detected -- but they also won't return correct data! Your dictionary of connection_details doesn't really help much either as the parameters are invalid for the oracledb.connect() call! Can you supply a standalone script that demonstrates your problem?

@avijit09
Copy link
Author

Hi Anthony, thanks for your reply. I did everything to install version 1.0.3. One of my team member could able to install the package and he didnt report any data loss after connecting to the db. I am not sure why I cant do the pip when others can!.

I can share the below but not sure it demonstrates my problem well ;

oracle_config = {
'type_dictionary' : {
'DB_TYPE_BFILE':'oracledb.LOB',
'DB_TYPE_BINARY_DOUBLE':'float',
'DB_TYPE_BINARY_FLOAT':'float',
'DB_TYPE_BLOB':'oracledb.LOB',
'DB_TYPE_CHAR':'str',
'DB_TYPE_CLOB':'oracledb.LOB',
'DB_TYPE_CURSOR':'oracledb.Cursor',
'DB_TYPE_DATE':'datetime.datetime',
'DB_TYPE_INTERVAL_DS':'datetime.timedelta',
'DB_TYPE_JSON':'dict, list or a scalar value 4',
'DB_TYPE_LONG':'str',
'DB_TYPE_LONG_RAW':'bytes',
'DB_TYPE_NCHAR':'str',
'DB_TYPE_NCLOB':'oracledb.LOB',
'DB_TYPE_NUMBER':'float or int 1',
'DB_TYPE_NVARCHAR':'str',
'DB_TYPE_OBJECT':'oracledb.Object',
'DB_TYPE_RAW':'bytes',
'DB_TYPE_ROWID':'str',
'DB_TYPE_TIMESTAMP':'datetime.datetime',
'DB_TYPE_TIMESTAMP_LTZ':'datetime.datetime 2',
'DB_TYPE_TIMESTAMP_TZ':'datetime.datetime 2',
'DB_TYPE_ROWID':'str',
'DB_TYPE_VARCHAR':'str',
},

@cjbj
Copy link
Member

cjbj commented Dec 12, 2023

but they also won't return correct data!

To reiterate: don't use 1.0.3 because you can lose data.

Try setting the environment variable ORA_SDTZ to a numeric offset before you run python. Support for this was added in python-oracledb 1.4.

@avijit09
Copy link
Author

Not sure where I can set this environment variable to a numeric offset!

Could you pls advise?

@cjbj
Copy link
Member

cjbj commented Dec 12, 2023

@avijit09
Copy link
Author

avijit09 commented Dec 12, 2023

thanks. should I add these into system variables or user variables? I am using 64 bit windows machine

set ORA_SDTZ='Europe/London'
set ORA_SDTZ='-05:00'
set ORA_SDTZ='OS_TZ'
set ORA_SDTZ='DB_TZ'

@cjbj
Copy link
Member

cjbj commented Dec 12, 2023

I am not a Windows user. It might depend how your app runs.

You would only execute one of those calls: the one with numeric value. Use the value you desire for your location or purposes.

@avijit09
Copy link
Author

ok. should it be ORA_SDTZ='+11:00' or

ORA_SDTZ=+11:00

@avijit09
Copy link
Author

Unfortunately it didnt resolve my issue. still experiencing the same issue

@cjbj
Copy link
Member

cjbj commented Dec 12, 2023

Since we don't know your code, or the actual error, there's not anything else for us to suggest.

Of course, if you want to share useful details, then we can certainly help.

@cjbj
Copy link
Member

cjbj commented Dec 20, 2023

Closing - no update

@cjbj cjbj closed this as completed Dec 20, 2023
@Chinmaya910
Copy link

Chinmaya910 commented Apr 17, 2024

hi
i am also getting the same error when trying to build a docker image

Dockerfile

FROM python:3.11.0-alpine

RUN apk update
RUN apk add glib-dev librdkafka-dev gcc
RUN apk update && apk add --update --no-cache python3 py3-pip &&
ln -sf python3 /usr/bin/python #--no-install-recommends
ENV PY_VERSION 3.11
#RUN apk add librdkafka-dev --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community

copy requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

Ran the following command
docker build -t kafkacheck .

error:

Failed to build oracledb
28.69 ERROR: Could not build wheels for oracledb, which is required to install pyproject.toml-based projects

requirements.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants