Python 2.7 The packaging package is required; normally this is bundled with this package

2024/10/14 5:14:37

I expect this has to do with the cryptography module, but I'm not sure.

Traceback (most recent call last):File "<string>", line 11, in <module>File "c:\python27\lib\site-packages\PyInstaller-2.1-py2.7.egg\PyInstaller\load
er\pyi_importers.py", line 270, in load_moduleexec(bytecode, module.__dict__)File "C:\Python34\Stuff\Encrypt\build\encrypt\out00-PYZ.pyz\pkg_resources", li
ne 68, in <module>File "C:\Python34\Stuff\Encrypt\build\encrypt\out00-PYZ.pyz\pkg_resources.exte
rn", line 60, in load_module
ImportError: The 'packaging' package is required; normally this is bundled with
this package so if you get this warning, consult the packager of your distributi
on.

And source:

import os, sys, getpass, time
from cryptography.fernet import Fernet
from tqdm import tqdm
from time import gmtime, strftime
import subprocess
name = getpass.getuser()
print strftime("%Y-%m-%d %I:%M:%S")
print "NOTE: Encrypting will delete all data in either .txt, so please save the data."
print "-------------------------------------------------------------------------------"
def copy2clip(txt):cmd='echo '+txt.strip()+'|clip'return subprocess.check_call(cmd, shell=True)
def delete():try:os.remove("key.txt")os.remove("Encryption.txt")except:print "Error, files not deleted."
def encrypt():input = raw_input("Please enter what you want to be encrypted: ")for i in tqdm(range(100)):time.sleep(0.01)key = Fernet.generate_key()cipher_suite = Fernet(key)cipher_text = cipher_suite.encrypt(input)plain_text = cipher_suite.decrypt(cipher_text)time.sleep(1)print "Encryption completed..."#savef = open("encryption.txt", "w")f.write(cipher_text)f.close()time.sleep(1)print "Encryption data saved to encryption.txt and copied to clipboard..."copy2clip(cipher_text)d = open("key.txt", "w")d.write(key + "\n\n")d.close()time.sleep(1)print "Key data saved to key.txt..."time.sleep(5)
while True:encrypt()os.system('cls')print strftime("%Y-%m-%d %I:%M:%S")print "NOTE: Encrypting will delete all data in either .txt, so please save the data."print "-------------------------------------------------------------------------------"time.sleep(5)

I noticed a file named cryptography.hazmat.bindings._padding.pyd, and I saw somewhere people were having problems with it. Do I need to edit the hook or something?

Answer

Try this

pip uninstall setuptools
pip install setuptools==19.2
https://en.xdnf.cn/q/117995.html

Related Q&A

Couple the data in all possible combinations

I have data in column in two columns like thisId Value 1 a 2 f 1 c 1 h 2 aand Id like couple the data of the Value column in all possible combinations based on the same Id such as(a,c) (a,h)…

Python - Find date from string

Would anyone know a regex string or another method of obtaining the date and time from this string into variables? The position of the string could change, so line and char no would not work. This is …

Get 1st column values on .csv file on python

i am newbie at python programming, i have a .csv file containing mac address and signal strength data from an AP consider my csv data is:i want to get just mac address values which is the 1st row, ref…

how to click mouse over sub menu in selenium?

I want to click invisible htmls sub menu click.*invisible html source<ul class="options"> <li class="_ranking-attr-filter-container _sub-menu-target"> <span>Hide w…

SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed (_ssl.c.661)

Im trying to install nltk on my Mac, but I keep getting this error message after following these instructions: Install NLTK: sudo pip install -U nltk Install Numpy (optional): sudo pip install -U numpy…

Real-time reading of terminal output from server

Im trying to process images from my camera on my server and get the information after processing on my local machine in real-time. I can get necessary information as terminal outputs on my server, but …

Transform map to mapPartition using pyspark

I am trying to load a tensorflow model from disk and predicting the values.Codedef get_value(row):print("**********************************************")graph = tf.Graph()rowkey = row[0]check…

Module google_auth_httplib2 not found after pip installing google-cloud How can I fix it?

I used pip to install cloud-storage, like this:$ pip install --upgrade google-cloudWhen I started my application, I got an error that said no module named google_auth_httplib2 was found. I used pip lis…

python unbinding/disable key binding after click and resume it later

Im trying to unbind/disable key once its clicked, and resume its function after 2s. But I cant figure out the code for the unbinding. The bind is on window. Heres the code that I tried so far:self.choi…

Extracting information from pandas dataframe

I have the below dataframe. I want to build a rule engine to extract the tokens where the pattern is like Eg. "UNITED STATES" .What is the best way to do it ? Is there anything like regex o…