Closed psp300xxx closed 2 years ago
Hi,
I did a quick test to see if I could reproduce the issue you are reporting,
I happen to be on a Mac running Big Sur but that shouldn't matter cause it's python! :-)
So, I'm not able to reproduce the issue.
Could you supply more details regarding what you ran? and how you ran it?
Hi, thank you for your answer.
I created a virtual env, there I ran :
python -m pip install blackduck
(my python version is 3.9.8)
Then I ran the following script:
from blackduck import Client
import logging
import os
from pprint import pprint
logging.basicConfig(
level=logging.INFO,
format="[%(asctime)s] {%(module)s:%(lineno)d} %(levelname)s - %(message)s"
)
bd = Client(
token=os.environ.get('blackduck_token'),
base_url="https://your.blackduck.url",
# verify=False # TLS certificate verification
)
Getting the error I mentioned
Try renaming your script from blackduck.py to something else. Having a script with the same name as a package you are trying to import may cause a problem.
Thank you, renaming the script solved my issue!
Super! Good luck with the Client class.
Hi, as the guide state, I installed blackduck using the command
pip3 install blackduck
, and everything looked fine, but when I run the test code I receive the following message:ImportError: cannot import name 'Client' from partially initialized module 'blackduck' (most likely due to a circular import) (C:\Users\luigi.demarco\blackduck_examples\blackduck.py)
, do you have any solution? I am running under Windows 10