添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
性感的煎鸡蛋  ·  msf 生成 shellcode 利用 ...·  2 小时前    · 
爱热闹的作业本  ·  python ...·  2 小时前    · 
痴情的墨镜  ·  python免杀Cobalt ...·  2 小时前    · 
痴情的眼镜  ·  MSF的python源码免杀 - ...·  2 小时前    · 
灰常酷的鸡蛋  ·  Carelon Behavioral ...·  3 周前    · 
多情的剪刀  ·  Python ...·  1 月前    · 
打篮球的领带  ·  sklearn.manifold.Local ...·  2 月前    · 

This advise doesn't seem to work. I'm trying to use the hashbang to switch to python 3.6: #!/usr/bin/python3.6

However, environment is still 3.8 when using save/run button, causing numpy issues:

File "/usr/lib/python3.8/site-packages/numpy/core/overrides.py", line 16, in <module> add_docstring( RuntimeError: implement_array_function method already has a docstring

I have 3.6 configured from my .bashrc but I don't think it's being sourced in that console. Am I missing something?

I am having this problem too! and it has gotten very overwhelming. the system does not even build the wxPython , numpy . I defined python 3.6 as my work environment and it keeps giving me the console on python3.8. Any solution not involving me to continue spending days trying to get this solved will be appreciated. NONE of the solutions in the wiki, forums, help or anywhere else online has solved it. I have lost days in this issue. Please forward an intuitive step by step solution. The libraries run well in the stand alone python application so seems the problem may be pythonanywhere. I hope the team to have compassive human delicacy to respond.

I have a similar issue where I cloned my GitHub repo and create a virtual environment with : mkvirtualenv --python=/usr/bin/python3.8.5 crs_venv

Then when I want to install my packages, I run: pip install -r requirements.txt

I get a depreciation warning and an error: ERROR: ipykernel-5.3.4-py3-none-any.whl is not a supported wheel on this platform.

if I instead install using pip3 , I get an error saying ERROR: Could not find a version that satisfies the requirement anaconda-client==1.7.2 (from -r requirements.txt (line 2)) (from versions: 1.1.1, 1.2.2) ERROR: No matching distribution found for anaconda-client==1.7.2 (from -r requirements.txt (line 2))

Any help would be appreciated.

Having the following error.

~/my_site/personal_web/mysite/my_app (main)$ python trial.py
Traceback (most recent call last):
  File "trial.py", line 37, in <module>
    with smtplib.SMTP_SSL("smtp.gmail.com", 465, context=context) as server:
TypeError: __init__() got an unexpected keyword argument 'context'

This did not happen 2 months ago. I had made sure all of my codes were running, but now none of them do.

[edit by admin: formatting]

Perhaps you were using a virtualenv earlier? When you're not using a virtualenv, the command python will run Python 2.7 (which is unfortunately a requirement of the operating system).

I can see that your website is configured to use a virtualenv called myproj, so if you wan the code that you're running from a Bash console to use that env, then you should first run the command

workon myproj

-- once that is done, you'll see (myproj) appear in the prompt in Bash, and the command python will be bound to the version of Python that your website uses, with all of the modules that you've installed into the virtualenv available.

Traceback (most recent call last):
  File "/home/fingerprint/mysite/finegerprint_pipline.py", line 79, in <module>
    results = fingerprint_pipline(img)
  File "/home/fingerprint/mysite/finegerprint_pipline.py", line 44, in fingerprint_pipline
    gabor_img = gabor_filter(normim, angles, freq)
  File "/home/fingerprint/mysite/./utils/gabor_filter.py", line 43, in gabor_filter
    array = np.linspace(-block_size,block_size,(2*block_size + 1))
  File "<__array_function__ internals>", line 5, in linspace
  File "/usr/local/lib/python3.10/site-packages/numpy/core/function_base.py", line 120, in linspace
    num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

Getting above error. i have tried it in my local with 3.7 and it was working fine. i have tried to create the VD for python 3.7 but it atkes as 3.10 by default. can you please help me on this

[edit by admin: formatting]

Yes, using save and run button in the editor.i have created the webapp using python 3.7 but when run the python file getting the error which seems like 'usr/local/lib/python3.10/site-packages/numpy/core/function_base.py'.

Please suggest i m kind of stuck here

Hi,Thank you so much! It's working fine. but now i have my Flask API. when i am trying to run my app i am getting below errors.

https://www.pythonanywhere.com/user/fingerprint/files/var/log/fingerprint.pythonanywhere.com.error.log

2023-04-06 11:43:56,792: Error running WSGI application
2023-04-06 11:43:56,796: ModuleNotFoundError: No module named 'utils'
2023-04-06 11:43:56,796:   File "/var/www/fingerprint_pythonanywhere_com_wsgi.py", line 16, in <module>
2023-04-06 11:43:56,796:     from finegerprint_pipline import app as application  # noqa
2023-04-06 11:43:56,796: 
2023-04-06 11:43:56,796:   File "/home/fingerprint/mysite/finegerprint_pipline.py", line 5, in <module>
2023-04-06 11:43:56,796:     from utils.poincare import calculate_singularities
2023-04-06 11:43:56,796: ***************************************************

I have this folder utils in mysite and i am using that in my different modules finegerprint_pipline.py file like below:

from utils.poincare import calculate_singularities
from utils.segmentation import create_segmented_and_variance_images
from utils.normalization import normalize
from utils.gabor_filter import gabor_filter
from utils.frequency import ridge_freq
from utils import orientation
from utils.crossing_number import calculate_minutiaes
from tqdm import tqdm
from utils.skeletonize import skeletonize

Please help me

[edit by admin: formatting]

import sys from utils.poincare import calculate_singularities from utils.segmentation import create_segmented_and_variance_images from utils.normalization import normalize from utils.gabor_filter import gabor_filter from utils.frequency import ridge_freq from utils import orientation from utils.crossing_number import calculate_minutiaes from tqdm import tqdm from utils.skeletonize import skeletonize from flask import Flask application = Flask(__name__) sys.path.insert(0, '/home/fingerprint/mysite/utils') @application.route('/') def hello_world(): return """ <title>Python Anywhere hosted web application</title> </head> <h1>Hello, World!</h1> This is the default welcome page for a <a href="https://www.pythonanywhere.com/">PythonAnywhere</a> hosted web application. Find out more about how to configure your own web application by visiting the <a href="https://www.pythonanywhere.com/web_app_setup/">web app setup</a> page </body> </html>""" def fingerprint_pipline(input_img): block_size = 16 # pipe line picture re https://www.cse.iitk.ac.in/users/biometrics/pages/111.JPG # normalization -> orientation -> frequency -> mask -> filtering # normalization - removes the effects of sensor noise and finger pressure differences. normalized_img = normalize(input_img.copy(), float(100), float(100)) # color threshold # threshold_img = normalized_img # _, threshold_im = cv.threshold(normalized_img,127,255,cv.THRESH_OTSU) # cv.imshow('color_threshold', normalized_img); cv.waitKeyEx() # ROI and normalisation (segmented_img, normim, mask) = create_segmented_and_variance_images(normalized_img, block_size, 0.2) # orientations angles = orientation.calculate_angles(normalized_img, W=block_size, smoth=False) orientation_img = orientation.visualize_angles(segmented_img, mask, angles, W=block_size) # find the overall frequency of ridges in Wavelet Domain freq = ridge_freq(normim, mask, angles, block_size, kernel_size=5, minWaveLength=5, maxWaveLength=15) # create gabor filter and do the actual filtering gabor_img = gabor_filter(normim, angles, freq) # thinning oor skeletonize thin_image = skeletonize(gabor_img) # minutias minutias = calculate_minutiaes(thin_image) # singularities singularities_img = calculate_singularities(thin_image, angles, 1, block_size, mask) # visualize pipeline stage by stage output_imgs = [input_img, normalized_img, segmented_img, orientation_img, gabor_img, thin_image, minutias, singularities_img] for i in range(len(output_imgs)): if len(output_imgs[i].shape) == 2: output_imgs[i] = cv.cvtColor(output_imgs[i], cv.COLOR_GRAY2RGB) results = np.concatenate([np.concatenate(output_imgs[:4], 1), np.concatenate(output_imgs[4:], 1)]).astype(np.uint8) return results if __name__ == '__main__': # open images img_dir = './sample_inputs/*' output_dir = './output/' def open_images(directory): images_paths = glob(directory) print(images_paths) return np.array([cv.imread(img_path,0) for img_path in images_paths]) images = open_images(img_dir) # image pipeline os.makedirs(output_dir, exist_ok=True) for i, img in enumerate(tqdm(images)): results = fingerprint_pipline(img) cv.imwrite(output_dir+str(i)+'.png', results) # cv.imshow('image pipeline', results); cv.waitKeyEx()
  • If you're running it from bash, use the python3.8 command instead of just python
  • If you're running it fun the editor, see this help page
  • If you want to use it for a website you've set up on the "Web" page, just change the version on that page.
  • If you're trying to run it some other way, could you give some more details?

    Sorry, we have had to rate-limit your feedback sending.
    Please try again in a few moments... Thanks for the feedback! Our tireless devs will get back to you soon.