FAQ Database Discussion Community


regex match everything after N column (delimiter is ,)

regex,pycharm,textmate
How can I match data after third column? (textmate or pycharm ...) ('col1', 'col2', 'col3'MATCH Input (175, 'ЗИП БУД-420М', 'Плата печатная в сборе, готовая к установке в корпус БУД-420М.', 'ЗИП БУД-420М', 'ЗИП БУД-420М', 'ЗИП БУД-420М', 'ЗИП БУД-420М', '', '', 'Плата печатная в сборе, готовая к установке в корпус БУД-420М.', 'ЗИП...

How to do type hinting for a template parameter in pycharm3?

python,django,pycharm
I noticed that when I use the function render or render_to_reponse in a django view, I can auto complete and referenced the template in the template string. When I tried to do the same for my method the string does not response the same way even though I named the...

pycharm console unicode to readable string

python,pycharm
studying python with this tutorial The problem is when i trying to get cyrillic characters i get unicode in pycharm console. import requests from bs4 import BeautifulSoup import operator import codecs def start(url): word_list = [] source_code = requests.get(url).text soup = BeautifulSoup(source_code) for post_text in soup.findAll('a', {'class': 'b-tasks__item__title js-set-visited'}): content...

I am getting a following error while using pycharm in windows 8.1

django,python-3.x,pycharm
I have started working on python/django. But while using settings.py for database connection, I am getting the following error. I am using pycharm in windows 8. "C:\Program Files (x86)\JetBrains\PyCharm 4.0.6\bin\runnerw.exe" C:\Python34\python.exe "C:/Users/hp user/PycharmProjects/edu/manage.py" runserver 8000 Traceback (most recent call last): File "C:\Python34\lib\site-packages\django\db\backends\mysql\base.py", line 24, in <module> import MySQLdb as Database...

How to add a live `directory ` template to PyCharm's `New` context menu?

intellij-idea,contextmenu,pycharm
In PyCharm, right clicking a folder in the "Project" hierarchy or pressing Alt + Insert will pop-up a context menu like the below image. For my projects, i create modules, and their base structure has many files. So how do i add a "Directory Template" in the context menu. Just...

Get access to another window textEntry (Python)

python,gtk,pycharm,glade
I'm using PyCharm and Glade user interface designer. My project contains two windows: Main and Secondary. Secondary window starts from Main. After some manipulation in Secondary window I should close it. But before I'm saving some data in a list. And when Secondary window is closed I want to fill...

what is difference b/w run python code in pycharm and terminal?

python,pycharm
when i run below python code in pycharm import pokitdok print dir(pokitdok) i got below output ['__author__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'pokitdok'] but when i run in terminal import pokitdok print dir(pokitdok) i get below output ['__author__', '__builtins__', '__copyright__', '__doc__', '__file__', '__license__', '__name__', '__package__', '__path__', '__title__', '__version__', 'absolute_import', 'api',...

PyCharm add remote Python interpreter inside the Docker

python,docker,pycharm,remote-debugging,boot2docker
So I have set up a docker on my laptop. I'm using Boot2Docker so I have one level of indirection to access the docker. In PyCharm, I can set a remote python interpreter via SSH but I'm not sure how to do it for dockers that can only be accessed...

Pycharm background for project tree and other service windows

pycharm
I changed default colour scheme of Pycharm (4.x) but it affects only editor area. I'd like to do the same with project tree, stack trace, watchers and all other windows. How could I achieve it?

How to create a scratch file in pycharm for Django

python,django,pycharm
I can create a scratch file from menu "Tools" -> "New Scratch File...". But Django settings and environment variables are not imported automatically. Is there a way to do that now or this feature is just meant for pure python code testing. I want to be able to from website.models...

GPS is not implemented for your platform - Kivy / Plyer / PyCharm

android,python,gps,pycharm,kivy
This is the example app given included in plyer. I want to see how it works because I'll use it in my project. I want to use the GPS function. But it says that it is not implemented for my platform :( How to make it work? Thanks! ...

How does Python know which number type to use in order to Multiply arbitrary two numbers?

python,c,pycharm,python-2.x
In C, I have to set proper type, such as int, float, long for a simple arithmetic for multiplying two numbers. Otherwise, it will give me an incorrect answer. But in Python, basically it can automatically give me the correct answer. I have tried debug a simple 987*456 calculation to...

PyCharm: Shadows built in name 'self', bug or feature?

python,class,pycharm,ironpython,self
I'm using PyCharm IDE; I love it for all the work it does for me. I found it very powerful in my process of learning python. It has all the hints about variables names, typos etc... However now I'm a little bit confused. When using PyCharm with IronPython 2.7, Pycharm...

Setting axis in matplotlib

python,python-3.x,matplotlib,pycharm
I'm learning matplotlib from guide and I'm having troubles with moving spines. After setting x and y axis pl.xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi], [r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$']) pl.yticks([-1, 0, +1], [r'$-1$', r'$0$', r'$+1$']) They are using spines function: ax = pl.gca() ax.spines['right'].set_color('none') ax.spines['top'].set_color('none') ax.xaxis.set_ticks_position('bottom') ax.spines['bottom'].set_position(('data',0)) ax.yaxis.set_ticks_position('left') ax.spines['left'].set_position(('data',0)) To...

Is it possible to use an Anaconda Python 3 environment together with Pycharm?

python-3.x,scipy,pycharm,anaconda
My basic problem is that I want to install scipy on a Window's machine for Python 3 and use Pycharm as my development environment. The suggestion from the Scipy Documentation as well as several StackOverflow posts (Installing NumPy and SciPy on 64-bit Windows (with Pip), Trouble installing SciPy on windows,...

PyCharm. Regular expression to replace all script src attributes

python,regex,django,pycharm
I need to refactor existing django code, by using {% static 'path/to/file' %} tag. I think it's possible to use PyCharm feature "Replace in path" with regex option. So, I need to replace my script tags, which now look like: <script type="text/javascript" src="/static/js/script.js"></script> To look like: <script type="text/javascript" src="{% static...

Pycharm: Error “Cannot perform Refactoring. Function is not under the source root”

pycharm
I am using pycharm 4.0.4 on windows 8 and my project structure is as follows: my_django_project (pycharm content root) -lib -docs -scripts (virtualenv) -my_project (pycharm source root) -tempaltes -management -models.py -views.py etc.... pycharm project interpreter: 2.7.2 virualenv at c:\path\to\my_django_project I am trying to perform a change signature refactor and a...

Is it wrong to use the “==” operator when comparing to an empty list? [duplicate]

python,list,pycharm,pep8
This question already has an answer here: Best way to check if a list is empty 14 answers PyCharm (4.0.6) complains when I do a comparison to an empty list using the == operator, but it doesn't when I use the is operator: I guess this is something related...

installing Anaconda on windows

python,python-2.7,pycharm,anaconda
Currently I have python 2.7 installed, and I decided to install Anaconda (same version). My questions are: What is the safest way to do it? Uninstall python 2.7 first? Can I move packages installed on my old python version manually (without reinstalling them again)? Should I change something in my...

expected string got property instead

python,dynamic,properties,pycharm,typing
Code snippet: def copy_additional_files(self): try: for filetocopy in self.files_to_copy: shutil.copy2(FileToCopy.get_source, FileToCopy.get_target) except NotImplementedError: logging.error('keep thinking') raise EwaException get_source is a @property that returns a string - shutil.copy2 needs a string to work My IDE (PyCharm 4.0.6) tells me that it expected a string but got a property instead. Is that...

Trailing spaces removed on Python heredoc lines in PyCharm

python,pycharm,multiline,heredoc,trailing-character
I'm using Python 2.7 with unittest2 within PyCharm community 3.4.1. I need to match the textual output of a CLI command with the contents of a string for an automated test. The output of this command frequently has trailing spaces at the end of lines; if I add spaces to...

arduino auto format equivalent in pycharm

python,pycharm,autoformatting
I´m having trouble formating my code. For example: for i in range(len(text)): text[i] = text[i].strip('"') text[i] = text[i].strip() print text, len(text) opreg_addr = int(text[2], 16) var_from = int(text[3]) var_to = int(text[4]) opvar_index = int(text[5]) bms.opvars[opvar_index] = bms.readbits(var_from, var_to, bms.opreg[opreg_addr]); I forgot to place a for loop before this code like...

Pycharm: Is there key shortcut for moving between instances of variable/function?

pycharm
I've looked in Pycharm documentation for available shortcuts, and could not find the one that i use(d) the most in Visual Studio : Ctrl+Shift + up/down arrows - which moves between instances of variable/function. Am I missing something? Is there any other way to do this? (I'm using Pycharm 4.0.6)

Is there any c++ IDE checking coding style as Pycharm does? [closed]

c++,ide,pycharm
Pycharm has a very nice feature to check coding style according to PEP8 conventions. It's good for python beginners to write decent code from the very beginning. I am wondering if there's any c++ IDE implementing similar features, for instance, checking google c++ coding style?

Working directory error

directory,pycharm
I am working with PyCharm 4.04. Since I installed it, every time I open it, as default directory I get this: C:\Users\Laura\AppData\Local\Temp\main.py1.tmp>cd Which gives me an error when trying to use the console: Error:Cannot start process, the path specified for working directory is not a directory But even if I...

How to install pycrypto in a Windows Vista64 virualenv created with PyCharm 4

python,python-2.7,virtualenv,pycharm
I created a virtualenv with PyCharm 4 on a Windows Vista 64 machine. I'm new to this type of setup on Windows. On Ubuntu I would just type source bin/activate. I tried that and it doesn't work. I am having trouble: Activating the PyCharm created VirtualEnv on Windows Installing the...

Python constructors convention

python,pycharm,convention
I wonder if there is any convention regarding constructor in Python. If I have a constructor doing nothing, I can basically not writing it and everything will work just fine. However when I'm using Pycharm, it is recommending me (warning) to write an empty constructor: __init__: pass I have not...

How can I fix my pyCharm installation?

windows,pycharm
When I start pyCharm I get this error msg: Load Settings Cannot load settings from file 'C:\Users\cleanup\.PyCharm40\config\options\editor.codeinsight.xml': content truncated File content will be recreated What can I do about it?...

Get PyCharm to stop asking for a VCS?

pycharm
How do I get PyCharm to stop asking for Git integration, or any other VCS? (my version is 4.0.4 professional) It keeps popping up telling me it couldn't find git.exe, but I wouldn't want it to integrate anyways....

Error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)

python,numpy,pycharm
Im trying to install numpy with PyCharm but i keep getting this error: error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat). Can someone please explain to me exactly what i have to do to fix this error(and as simple and detailed as possible)? im using python 3.4.2...

Run Menpo and Menpofit with PyCharm

python,pycharm,packages,menpo
I trying to explore Menpo and Menpofit with PyCharm IDE. I have installed required packages but I have some issue: from .fastpwa import CLookupPWA; ImportError: cannot import name 'CLookupPWA' from .normals import compute_normals; ImportError: No module named 'menpo.shape.mesh.normals' So how I can run Menpo and Menpofit with PyCharm?...

custom pycharm plugin always disabled

intellij-idea,pycharm,intellij-plugin
I tryed a very simple plugin (with just an AnAction), and when I run or deploy it the result is: On PyCharm SDK: The plugin is disabled. On Intellij Community Edition: it works as expected PyCharm is my primary target, so I need it to works, but have no clue...

“Empty test suite” by running Django tests with Pycharm (tests are found if launched from the shell)

python,django,unit-testing,pycharm
I'm having an hard time trying to run my Django tests using PyCharm. I did it easily in the past using a "python running configuration" in which I used manage.py to run them, I was on OSX and using python 2.7, Django <= 1.7, Pycharm <= 4. Now I'm on...

PyCharm: how to use an open source project in my project

pycharm
I want to build a simple tool that uses functions from an open source project from GitHub, SourceForge, etc. (e.g., a project such as https://github.com/vishnubob/python-midi/). I searched the documentation but could not find the right way to do this. (I assume I need to point PyCharm at the source somehow...

Why isn't PyCharm's autocomplete working for libraries I install?

python,pycharm
PyCharm's autocomplete isn't working for installed libraries. I have the following code: from boto.emr.connection import EmrConnection conn = EmrConnection(aws_keys.access_key_id, aws_keys.secret_key) I want the editor to tell me what methods I have available to me when I press ctrlspace. The boto library is installed in my environment, but it doesn't seem...

Pycharm project imports modules incorrectly

python,flask,pycharm
I have a repo with a Flask webapp and a separate python directory, and I'm using PyCharm. My project directory is: /backup/ __init__.py python modules etc /webapp /py __init__.py /lib __init__.py python code /src __init__.py python code /static js, css, fonts etc /templates html webapp.py I'm trying to import a...

ImportError: No module named 'sha'

python,python-3.x,pycharm,sha
all, I tried to import sha in a python file, but got the error message when compiling the file. ImportError: No module named 'sha' I am using pycharm 4.0.4 with python 3.4.2 installed on Win 7. I am wondering how to solve the problem....

Is there a way in PyCharm to check an object's methods while debugging?

python,debugging,pycharm
While debugging in PyCharm, it's easy to check an object's fields while execution is suspended. Is there a way to similarly check the object's methods from the IDE, or is this a feature that has just not been implemented by JetBrains? The builtin hasattr function checks for both, so one...

How to access pycharm code inspectors internals

python,pycharm,call-graph
I am using Pycharm for writing my code and would like to access the internals of it's inspectors to pull out the static call graphs for my program (something that Pycharm is already doing in my understanding in order to perform autocompletion and declaration order verification). Is there a way...

Python + Flask App runs from wrong folder after run by Pycharm on 127.0.0.1

python,sqlite,flask,sqlalchemy,pycharm
Setup: I have created and populated a sqllite database in Pycharm, running Python + Flask + SQLAlchemy. The code works perfectly in the console, but when i run it, i get a: OperationalError: (sqlite3.OperationalError) unable to open database file Problem: When i run print os.getcwd() in Chrome/Flask-Werkzeug: C:\Program Files (x86)\JetBrains\PyCharm...

Open a new scratch file in PyCharm?

python,pycharm,scratch-file
In PyCharm 4.5, one of the new features is listed as "Temporary Python Scratch Files". How do I create these? I've searched through the "New" menu and haven't been able to find it. When I select "New...", I am given the option to create permanent files....

how to install library in pyCharm?

python,numpy,pip,pycharm
i am new to python(2.7) and i am using pyCharm 4.0.6 community on Ubuntu 14.04 and i am working in a school project and i am supposed to use numpy library so whenever i try to install numpy it gives me that error "collect2: error: ld returned 1 exit status"...

Documentation Pop Ups

python,pycharm
How can I configure Pycharm such that I always have the documentation pop up every time I hover over a method or an class? For example in eclipse: If I hover the cursor over a c++ function or a class, I can see the documentation for the same in a...

PyCharm: Exporting Local History

pycharm
I'm using PyCharm on OSX, and I just found out about the local history feature. However, the local history for a file is only maintained for at most 23 days(Going beyond that causes local history to stop working), 5 by default. I found two files named changes.storageData and changes.storageRecordIndex in...

Pycharm (@property) and (@x.setter) autogeneration

python,pycharm
I wonder whether there is some way of using Pycharm to automatically generate getter(@property) or setter for all my variables in a class. If there is a way, can someone point it out ? thanks! Actually I meant to generate (@property) and (@x.setter) automatically....

Can PyCharm automatically generate __init__(), __eq__() and __hash__() implementations?

python,intellij-idea,pycharm
I am a PyCharm newbie but a long-time IntelliJ user. In IntelliJ, when you are writing a class definition, the IDE can automatically generate a constructor, equals() method, and hashCode() method based on the instance variables. This is good not just for saving typing, but for preventing inadvertent errors and...

Django first app: error during the creation of sql tables from my models

python,django,django-models,pycharm
I'm new in Python and I would to start some tutorial using Django. I would use PyCharm as IDE. So, I tried to create my start Django project. I use a Mac, Python 2.7.5 version, Django 1.7.5 version. I follow this tutorial to create my first Django app. When I...

Intellij - Hide file paths from Favorites window

intellij-idea,phpstorm,pycharm,webstorm
I organized my project files in the Favourites window according to the programming language e.g. python, javascript etc. However, the path to each file takes a lot of space and requires you to horizontaly scroll the window. Is there a way to hide path from the Favourites, so only file...

Did pycharm has hint that make method become grey when not being called?

pycharm
When I used android studio, this hint is amazing that can let me know the unused method in my program. But when I use pycharm, this hint is gone? Do anyone know that this hint function is still in pycharm or not? can I turn this function on?

Autocomplete importing with PyCharm

python,pycharm
How come I can't get rid of these red underlines? And that I can't autocomplete import in PyCharm? datatype.py: class DataType: def __init__(self, name): self.name = name def set_value(self, value): self.value = value def get_value(self): return self.value Here it is being used in address.py: ...

Pycharm PyQt4 Autocomplete Not Working for Virtualenv

python,autocomplete,pyqt4,pycharm
For the past couple of days I've tried to get Pycharm autocomplete working for PyQt4 when running a virtualenv on Ubuntu 14.04. The code works perfectly fine, it's just that all the imports are marked as red and I get zero autocomplete when writing code. So far I've tried: copying...

Finding the source code for a Python module

python,numpy,pycharm
I'm using PyCharm as my editor and seemingly it doesn't behave well with certain sub-modules namely numpy.random.normal. Not to be disheartened I tracked down where numpy.random lives to /usr/lib/python2.7/dist-packages/numpy/random. I can't see any instance of normal. There's the definition for it in __init__.py but no actual code for me to...

PyCharm displays rubbish characters with Inconsolata

fonts,pycharm
I am using PyCharm Community Edition 4 (on Windows 8.1) Build: #PC-139.1659, and tried to specify Inconsolata as the primary font. This is what I immediately get in the Settings --> Editor --> Colors & Fonts --> Font dialog: As can be seen in the second paragraph in the above...

Adding my Widget to Kivy App __init__ leads to blank screen and Warning

python,pycharm,kivy
I started with the Kivy Crash Course a few days ago and wanted to write a memory game. My App Class looks like that: class MemoryApp(App): def build(self): self.mgw = MemoryGameWidget() return self.mgw This code works with my .kv file. I always check my code with Pycharm Code Inspect. Pycharm...

What is the use of PyCharm's docstring template? How do I use it effectively?

python,coding-style,documentation,pycharm,docstring
PyCharm, the Python IDE generate a template for docstring as I start to type in the docstring. This is the template generated for a simple function. def add_them(x, y): """ :param x: :param y: :return: """ z = x + y return z I dont find it anything similar to...

How to debug in Pycharm

python,pycharm
Is there something special I need to debug in Pycharm? I have the following code: def main(): print "Hello World" if __name__ == "__main__": main() and I have breakpoints on each. I hit Debug and it gives me some windows and prints both lines even though I have breakpoints on...

PyCharm show full diff when unittest fails for multiline string?

python,unit-testing,pycharm
I am writing some Python unit tests using the "unittest" framework and run them in PyCharm. Some of the tests compare a long generated string to a reference value read from a file. If this comparison fails, I would like to see the diff of the two compared strings using...

Showing previous searches in PyCharm

eclipse,full-text-search,pycharm
Eclipse allows viewing one's previous searches in one's search history even going so far as to show the exact state in which one left a previous search. For example, if one removed (i.e. excluded) a search result from a previous search, that previous search is shown without that search result...

Why is Pycharm so concerned with the specific style I code with

pycharm
I've recently started studying Python and my teacher has recommended that I use Pycharm as an IDE. I do like it mainly but coming from java and eclipse there's a few things that don't make much sense to me. 1.)When I type the code, 'print("hello")' it will give me this...

Can't import pandas into pycharm interpreter, despite changing pyCharm python interpreter path

python,pandas,pycharm
I'm trying to import pandas in the pyCharm python interpreter, but I keep on getting the dreaded >>> import pandas Traceback (most recent call last): File "<input>", line 1, in <module> File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ImportError: No module named pandas It works...

Unresolved reference when using class

python,class,methods,pycharm
I'm having an issue with my code. I'm currently learning Python and we have to create a class Student which needs to take the name, number, mid. grade and final grade of a student. We then need to define a method showing the average grade the student got. class Student:...

Any better way for doing a = b + a?

python,string,pycharm
I'm using PyCharm and I have this statement: a = 'foo' b = 'bar' a = b + a and PyCharm highlights the last line saying that: Assignment can be replaced with augmented assignment First I thought there might be something like this but ended up with error: a +=...

Does PyCharm Have Spyder's Variable Explorer Functions (mainly “Save As” and “Import”)?

python,ide,pycharm,spyder
I started playing around with PyCharm today, and it seems like this is the Python IDE I want to start working with in the near future. Currently, I am using Spyder from Anaconda. What I really like about Spyder is that I am able to export and import variables from...

Why are my imports no longer working?

python,google-app-engine,pycharm,wtforms
I refactored my webapp and now my IDE pycharm marks some imports red. Why? from wtforms import Form, TextField, validators, SelectField My IDE marks the Form, TextField and the SelectField red as they cannot be imported. ("Unresolved reference"). What should I do if I need those classes in my project?...

Pycharm upgrade to 4.0.5 causes issues

python,ide,pycharm,freeze
I've been using PyCharm 4.0.4 (community edition) for a while without problems and just updated to PyCharm 4.0.5. When trying to modify a project that I had developed in 4.0.4, the IDE suddenly hangs even though I'm simply typing into the editor/adding a comment/etc. I'm not even attempting to run...

Debugging twisted application using PyCharm

python,debugging,twisted,pycharm
I am fighting a few hours trying to configure PyCharm for debugging my app. I was looking for solution, but twisted seems to not be so popular and there is weak support. Below I put error log that i got. /usr/local/bin/python3.4m -u /Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_run_in_console.py 57276 57277 /usr/bin/twistd -y /Users/artur/projs/private/elanga-web/start_app.tac Running...

How to turn on “unused imports” highlighting in PyCharm

pycharm
My PyCharm doesn't mark any imports as unusing. Me (os is not using): Should be (found this picture in web): How can I enable it?...

See stdout when running bash script in PyCharm

python,bash,stdout,pycharm
I use a bash script to call several python scripts. I installed the bash plugin for PyCharm. I can run the script, but I don't see stdout during runtime, even though I see it after everything finished. How can I make that visible during runtime?

Can't open Django shell from PyCharm using manage.py shortcut

django,python-2.7,pycharm
I can run Django shell directly from terminal in PyCharm, but I can't run it from manage.py shortcut (tools -> manage.py task -> shell). But I can do any other operations using this shortcut. When I am trying to run it using second way nothing happens. I am using Django...

No module named .. while running Django tests with PyCharm

django,pycharm,django-testing
I have the following error when running Django's tests with PyCharm 4.5 ImportError: No module named date_utils. Here is a short overview the project tree: . ├── manage.py ├── settings.py ├── app1 │   ├── models.py │   ├── __init__.py #Empty ├── utils │   ├── __init__.py #Empty │   ├── date_utils.py In app1.models.py,...

PyCharm Not Properly Recognizing Requirements - Python, Django

python,django,pycharm
Often requirements show up in requirements.txt like this: django-registration But in INSTALLED_APPS it appears as registration. So when you import like: from registration.signals import user_registered This is valid but PyCharm is showing a red squiggly line under the word registration in from registration... that says "Package 'registration' is not listed...

[pycharm remote python console]: “cannot connect to X server” error with import pandas

python,qt,matplotlib,ssh,pycharm
I configured a remote python interpreter for PyCharm and connected with SSH credentials. The whole setup works fine, except when I try to import any python library which uses Qt, such as pandas or matplotlib. I put a screenshot of the remote python console with this error. When I separately...

Add pygame module in PyCharm IDE

python,python-2.7,terminal,pygame,pycharm
I've downloaded pygame-1.9.1release.tar.gz from the Pygame website. I extracted and installed it and it's working fine in the command line Python interpreter in Terminal (Ubuntu). But I want to install it for some IDE, like PyCharm. How can I do it?

Window is closing immediately after I run program in PyQt 4 (anaconda) [PyCharm 4.5]

python,window,pyqt4,pycharm
So, I am trying to run a very simple program (a window) in Pycharm that is running anaconda 2.7 & PyQt4. Whenever I click the Run button it opens my program but closes the window too fast for me to even see it. May anyone, please help? Thank you! P.S....

Python will not print even test strings after calling a join. Executes with code 0 though

python,python-2.7,beautifulsoup,pycharm
I am writing some Python code to rename some files. In doing so, I have ran across a peculiar error. When I try to print anything after my join, nothing will print. Not even print 'test'. What could be causing this? Here is the code : ... #finding all images...

Pycharm 3.4.1 - “AppRegistryNotReady: Models aren't loaded yet”. Django Rest framewrok

python,django,pycharm
I'm using DRF and Pycharm 3.4.1 and Django 1.7. When I try to test my serializer class via Pycharm django console, it gives me the following error: Code from items_app.serializers import ItemSerializer s = ItemSerializer() print(repr(s)) then cause the following error traceback: Traceback Traceback (most recent call last): File "<input>",...

Python sqlite3 assertion error

python,python-3.x,sqlite3,pycharm,bottle
I am pretty sure the code I am doing is logical and makes sense but when I run it against my test the result comes back quite unusual, I am trying find a session from a cookie, and then use it to retrieve the user from the sessions table. I...

“executable not specified” error in Pycharm

python,ide,pycharm
When I try to run a python script in Pycharm, I get this error message: error running myscript: Executable is not specified and the script does not run. How do I run my script through Pycharm?...

Pycharm type hinting of custom modules

python,autocomplete,ide,pycharm,type-hinting
Consider this file system: a __init__.py b.py c __init__.py d.py main.py b.py: class B: def foo(self): print("foo") d.py: class D: def bar(self): x = None """:type : B""" #^- working y = None """:type : a.b.B""" #^- nope :( My goal is to use full path to class for type...

how to provide 'make directory as source root' from pyCharm to terminal

python,path,pycharm
I have some problems with migrating to production: [email protected]:~/workspace/PEP$ python ./dev_scrapers/jordan.py Traceback (most recent call last): File "./dev_scrapers/jordan.py", line 3, in <module> from utils import create_entity, create_id, custom_opener ImportError: No module named utils i have used pyCharm with button 'make directory as source root' how to execute such command in...

django - run project from PyCharm server not accessible

django,server,pycharm
When I run my django server from PyCharm it is not accessible from the outside world. I read that you can run in the cmd like that, and it works. python manage.py runserver 0.0.0.0:8000 How do I run it to be accessible to the outside world from PyCharm? I need...

Extracting particular element in HTML file and inserting into CSV

python,html,csv,beautifulsoup,pycharm
I have a HTML table stored in a file. I want to take each td value from the table which has the attribute like so : <td describedby="grid_1-1" ... >Value for CSV</td> <td describedby="grid_1-1" ... >Value for CSV2</td> <td describedby="grid_1-1" ... >Value for CSV3</td> <td describedby="grid_1-2" ... >Value for CSV4</td>...

How to set a project as startup project in PyCharm

python,pycharm
I have two projects in PyCharm, which are called A and B... Each one has several files in addition to a main file, i.e. a_main.py and b_main.py How can I switch between two projects for choosing one to be run? In other words, how could it be possible to select...

Disable Automatic unittesting in PyCharm

pycharm
PyCharm automatically detects when files begin with test_, and tries to run them as Unittests. Which is very considerate, but something seems to be broken, and on any test I run, I get /Users/peter/projects/plato/venv/bin/python2.7 "/Applications/PyCharm CE.app/Contents/helpers/pycharm/utrunner.py" /Users/peter/projects/plato/utils/tools/test_sampling.py::::test_samplers_not_broken true Testing started at 10:58 AM ... Traceback (most recent call last): File...

IntelliJ align multiple lines of code vertically

intellij-idea,vertical-alignment,pycharm
I am wondering how to align (the keyboard shortcut) a line or a block of code with the previous line, so that they have the same indention or starting from the same column in IntelliJ and PyCharm. cheers...

How to use PyCharm and WebStorm in the same editor

intellij-idea,reactjs,pycharm,webstorm
I'm working on a project involving python and javascript (react). I would like to know if someone knows a way to use pycharm and webstorm in the same editor or if there is a plugin to add react support to PyCharm. Thanks for your help....

How can I install Pygame to Pycharm?

python-2.7,pygame,pycharm
I recently installed pycahrm, I installed PIP and tried to install Pygame. There wasn't a just "Pygame" but there were sound effects and other things for it. What I really want is to install Pygame onto my pycharm.

SyntaxError: Non-ASCII character '\xe3' in file G:\test.py on line 2, but no encoding declared

python,encoding,utf-8,pycharm
I have a simple script. # -*- encoding : utf-8 -*- episode_title = "ザ・ロック(日本語吹替版)".decode('utf-8') print episode_title.encode('utf-8') But it doesn't work at my cmd console (Win8 PC, encoding is big5). SyntaxError: Non-ASCII character '\xe3' in file G:\test.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details Although I have...

PyCharm automatically change script

python,configuration,pycharm
In PyCharm, is there a way to automatically change the script in Run/Debug Configurations to the file I am currently editing? Currently, when I create a new file, I manually edit the Script in Configurations to the one I want to run.

Running Flask with pycharm

python,flask,pycharm
I'm trying to follow https://developers.openshift.com/en/python-flask.html, to set up a flask app on openshift. I've followed the directions and have got it working at the command line using git-bash on win7. /myflaskapp (master) $ python wsgi.py 127.0.0.1 - - [16/Jun/2015 13:46:10] "GET / HTTP/1.1" 200 12 127.0.0.1 - - [16/Jun/2015...

Different PyCharm and IDLE Python versions

python,pycharm,versions
I have installed Python 2.7.9 64 and 32 bit versions. I have also installed PyCharm for better easing with the learning (I just recently started learning Python). The problem is that Pycharm and IDLE show different Python versions when usng sys.version, even though they use the same path for the...

PyCharm coffee filewatcher

django,coffeescript,pycharm
I got this directory structure (django project): -myproject +mysite -myapp -static -myapp -script -coffee +views +controllers +models app.coffee -js +views +controllers +models manage.py How can i set coffeescript watcher to save *.js files in the same subdirectory of js directory. For example: /coffee/app.coffee -> /js/app.js /coffee/views/myview.coffee -> /js/views/myview.js...

Pycharm 4.5 CE crashes on launch on OS X 10.8.5

osx,pycharm
I upgraded from Pycharm 4.0 (which worked fine) to 4.5 community edition on Mac OS 10.8.5. It crashes on launch after bouncing a bit in the dock. The log files, console, all show nothing. I'm running java 1.6.0_65, and have Python 2.7, Jython, PyPy via Macports. Any ideas?...

How to get PyCharm IDE to do code completion for pygame's sub-modules?

python,python-2.7,pycharm
Intro: pygame is a python module used to create games. I've properly installed the module and my PyCharm successfully imports it. I'll jump straight to an example scenario: Trying to use the get code completion for the sub-module "image" under pygame works fine: pygame.image When I type further and try...

Is this a bug in PyCharm 4.0.5?

django,python-3.x,pycharm
I updated to PyCharm 4.0.5 yesterday and since then it has been marking some perfectly valid code as being an error. Basically the code is just iterating over a ManyToMany relationship. The code is shown below. songs = [] for album in order.album_products.all(): album_songs = Song.objects.filter(album__exact=album.album_product.id) if not album_songs: for...

Problems while importing pyaudio

python,pycharm,pyaudio
I recently bought a new laptop , and i moved my files from my old laptop. I was working on a project in pycharm which used the module pyaudio , i tried to run it and i got an error saying there is no module called pyaudio. I ran "apt-get...