python-module

Django 1.7 conflicting models

感情迁移 提交于 2019-12-28 16:34:08
问题 I install my application in "project/apps/myapp" folder. Both apps and myapp folders have init .py files(Without any of them there is module missing error). Now I've the error: Exception Type: RuntimeError at / Exception Value: Conflicting 'person' models in application 'resume': <class 'apps.resume.models.Person'> and <class 'resume.models.Person'>. Django import the same model with two different pathes. How can I fix it? Full error log: Traceback: File "/home/voxa/.virtualenvs/42-test/local

Playing remote audio files in Python? [closed]

不羁岁月 提交于 2019-12-28 13:36:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm looking for a solution to easily play remote .mp3 files. I have looked at "pyglet" module which works on local files, but it seems it can't handle remote files. I could temporary download the .mp3 file but that's not reccomended due to how large the .mp3 files could appear to be. I rather want it to be for

Python cannot see installed module `news`

梦想的初衷 提交于 2019-12-25 09:35:34
问题 Python declares that the news module is not installed: $ python -c "import news" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named news Even though: $ pip show news Name: news Version: 1.0 Summary: my first python module Home-page: UNKNOWN Author: sang Author-email: 1975001828@qq.com License: UNKNOWN Location: /usr/lib/python2.7/site-packages Requires: $ python -V Python 2.7.10 $ echo $PYTHONPATH :/usr/lib/python2.7/site-packages $ python -c

Python Module Not Found Issues after moving directory

岁酱吖の 提交于 2019-12-25 09:25:53
问题 I am working on some repacking of a project that has a variety of different technologies involved. I am trying to move a python module into the project structure for storage in git and have all project files located together. The python code works in its on folder. I have empty __init__ in each folder and there are no problems with from Documents import * When I move the folder into my larger project, all of these imports fall apart. Can anyone please help me to understand what is different?

log messages from non-default module not showing up in google app engine console

我与影子孤独终老i 提交于 2019-12-25 07:58:10
问题 My app has two modules, one of them configured to run on a manual scaling instance. In the developer console I am able to see the log messages printed by the default module, but not the ones printed by the other module. Is there some setting that I need to enable to see these logs? Also, if someone has a sample project in python that uses multiple modules (one of them configured to run on manual scaling instance), I would appreciate it if you could point me to it, 回答1: Logs for each modules

Azure Machine Learning Web service Input Data Issue

眉间皱痕 提交于 2019-12-25 07:13:27
问题 I have created an Azure ML webservice as an example and face an unknown error when it comes to deploy a web service. The error comes without an explanation, so it's hard to trace. When running the experiment within the studio, the experiment was running without any issue. However, when deploy to webservice, the test function has failed with the same input as in the studio. I have also published a sample of the service to see if anyone can see what the issue is. https://gallery

Reloading a function within a module

寵の児 提交于 2019-12-25 01:58:59
问题 Goal I would like to import a custom module from the interpreter, run it, modify it, reload it, and run it again to see the changes. Background I'm using python 2.7. Before I started writing my own modules, I made great use of the reload() function in python 2.7. I reproduced my issue in a simple example I create a folder called: demo Inside demo , I place two files: __init__.py and plotme.py My __init__.py file contains: from .plotme import plot My plotme.py file contains: import matplotlib

Python C Wrapper Memory Leak

巧了我就是萌 提交于 2019-12-25 01:49:12
问题 I am moderately experienced in python and C but new to writing python modules as wrappers on C functions. For a project I needed one function named "score" to run much faster than I was able to get in python so I coded it in C and literally just want to be able to call it from python. It takes in a python list of integers and I want the C function to get an array of integers, the length of that array, and then return an integer back to python. Here is my current (working) solution. static

How to install a Python package system-wide on Linux?

南楼画角 提交于 2019-12-24 20:16:15
问题 I often encounter some python packages (which I installed using pip) which can be accessed like a standalone binary on Terminal . Not just a python module . I want to know the standard way to create a package which can be installed by $pip install mypackage ( or by $python setup.py install ) and is also available like $mypackage from anywhere. I know that I can access the __main__.py file by $python -m mypackage . But I want my package to function just like any binary stored in /usr/bin . I

How to copy a Python module and it's dependencies to a file

回眸只為那壹抹淺笑 提交于 2019-12-24 18:27:24
问题 I want to use a Python module like urllib.request but have all the module's dependencies in a file where I can use them on a computer without having the entire Python installation. Is there a module or tool I can use to just copy a specific module into a file and it's dependencies without having to go through the entire script and copying it manually. I'm using Python 3. 回答1: There's a variety of options available to do this sort of thing. The one that comes to mind first off the top of my