Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6926517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:55:43+00:00 2026-05-27T10:55:43+00:00

Im trying to import a company module into my software and I get the

  • 0

Im trying to import a company module into my software and I get the error:

ImportError: No module named config

from:

from pylons.config import config

So obviously, the module that im importing requires pylons.config but cant find it in my virtual environment.

If I go to the terminal and try some Python scripts I can seem to find the config file if I try:

from pylons import config

but will error if I try:

import pylons.config

Why is this?

And does anybody how or where I can get:

 from pylons.config import config

to work. Bearing in mind that I cannot change the code for this module, only mine which is importing it or my own system files.


UPDATE

If anyone finding this page has a similar problem you may find that you are trying to run two modules with different versions of Pylons.

For example, you are creating a login application called myApp. You have some Python modules which help with login handling called pyLogin.

First you install pyLogin with python setup.py install. This adds the libraries to your site packages and updates any libraries it depends on, such as SqlAlchemy.

Next you install myApp in the same way which again updates libraries and dependencies.

This problem will occur if pyLogin and myApp are using different versions of Pylons. If pyLogin is using Pylons 0.9.6 and myApp is using Pylons 1.0 for example, then the pyLogin code will be called from myApp but it will be running in the wrong Pylons framework and hence will require EITHER from pylons import config or from pylons.config import config, but will only work with one. If it is using the wrong call for Pylons then you will find yourself with this error message.

So the only solution to this error is to either find earlier or later libraries which use the same Pylons version as your application or to convert your application to the same Pylons version as the libraries you are using.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:55:43+00:00Added an answer on May 27, 2026 at 10:55 am

    There is a diffrence between two usages…

    import loads a Python module into its own namespace, while from loads a Python module into the current namespace.

    So, using from pylons import config imports config to to your current namespace. But trying to import a class or function using import is not possible since there is no namespace to keep them… You can only import modules, and use functions or classes via calling them with their own namespace like

    import pylons
    ....
    pylons.config #to retreive config
    

    More about import in Python

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to import cv in python I get: ImportError: No module named cv.
I've been trying to import a table from oracle 10g into SQL Server 2005
So I am trying to import a module foo that contains directories bar and
I am trying to import BlackBerry code and into Eclipse from SVN. It isn't
I’m trying to import fixed width data from text file into SQL Server Express
I'm trying to import a model from a Django application and getting an error:
I am trying to import data from a FoxPro database into Sql Server however
In module MainClass.py which is in c:\MyProject\ModelClasses I'm trying import module MainHelper.py from c:\MyProject\Helpers
I am trying to import data from a mySQL database into Microsoft SQL because
Hi I'm trying to import a shape file from http://www.nyc.gov/html/dcp/html/bytes/bytesarchive.shtml into a postgis database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.