Git Product home page Git Product logo

Comments (12)

billtubbs avatar billtubbs commented on May 27, 2024 75

I thought I had this problem. Then I realised it's because I had created a script called profile.py to run the profile! (This causes AttributeError: module 'cProfile' has no attribute 'run'). Hope that helps!

from ci_edit.

dschuyler avatar dschuyler commented on May 27, 2024

Thanks for reporting this. I normally test with Python 2.7.10 and 3.7. I downloaded Python 3.6.8 and tried that but didn't see an issue.

Please paste the output from
$ python3 --version
into this bug so that we can see the specific 3.6 version and which platform this is happening on.

Also, consider trying Python 3.7 to see if the problem happens in that version.

from ci_edit.

navan0 avatar navan0 commented on May 27, 2024

It's python 3.6.7

from ci_edit.

gennad avatar gennad commented on May 27, 2024

Do we need profiling of programs for regular users at all? Maybe add some flag like "--dev" to enable profiling?

from ci_edit.

dschuyler avatar dschuyler commented on May 27, 2024

@gennad, sounds good.
I'm a bit concerned that the Python install on @navan0 's machine is damaged(?). While @gennad is correct about not needing this code, it should still work without crashing afaik.

from ci_edit.

navan0 avatar navan0 commented on May 27, 2024

hmm i will reinstall and check

from ci_edit.

dschuyler avatar dschuyler commented on May 27, 2024

Good to know!

Where was the profile.py created? (Was it in the ci_edit directory - with the ci.py file?)

from ci_edit.

billtubbs avatar billtubbs commented on May 27, 2024

It was in the current working directory - the profile.py script was the script I was actually running which did some setup and called the module which had the function I wanted to profile. Just a classic case of don't give your script the same name as a Python package in your path... Now I renamed it speedtest.py.

from ci_edit.

dschuyler avatar dschuyler commented on May 27, 2024

Thanks again. Since it's been awhile since Navan0's report and the description from billtubbs seems reasonable, I'll close this (assigned to billtubbs to credit billtubbs).

from ci_edit.

Abhihugar avatar Abhihugar commented on May 27, 2024

import cProfile to run

from ci_edit.

Abhihugar avatar Abhihugar commented on May 27, 2024

it has run attribute

from ci_edit.

Abhihugar avatar Abhihugar commented on May 27, 2024

import cProfile
import re

for i in range(5):
print(pr.calibrate(10000))
a=cProfile.run('re.compile("Hello")')
print(a)

from ci_edit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.