Modify

Opened 11 years ago

Closed 10 years ago

#769 closed defect (fixed)

'import perforce' doesn't work after installing PyPerforce

Reported by: vikas.bn@… Owned by: Lewis Baker
Priority: normal Component: PerforcePlugin
Severity: normal Keywords:
Cc: Trac Release: 0.9

Description (last modified by Noah Kantrowitz)

Hi,

I installed PyPerforce so that I could use Trac with the p4 backend. However after following the instructions to build and install the plugin, when i open a python shell and do import perforce, i get the following error:

   $ python
Python 2.4.2 (#2, Feb 24 2006, 18:16:05)
[GCC 3.3.6] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import perforce
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "build/bdist.linux-i686/egg/perforce/__init__.py", line 48, in ?
  File "build/bdist.linux-i686/egg/perforce/api.py", line 7, in ?
  File "build/bdist.linux-i686/egg/perforce/api.py", line 6, in __bootstrap__
ImportError: /remote/vtghome6/vikasbn/.python-eggs/PyPerforce-0.3a1-py2.4-linux-i686.egg-tmp/perforce/api.so: undefined symbol: _ZN10ClientUser16SetOutputCharsetEi

Have I missed anythig during the build process?

Also note that the PyPerforce, Trac and related plug-ins are installed on non-standard installation path (in my home-dir) as I don't have root access on those machines.

-vikas

Attachments (0)

Change History (4)

comment:1 Changed 11 years ago by Lewis Baker

This seems to be a PyPerforce build problem. It usually occurs when building PyPerforce using P4api libraries that don't match the runtime/compiler versions of used by Python.

Have a look here for the either the 'pic' libraries, if the gcc command line uses -Fpic, or the non-'pic' libraries and try rebuilding.

If that doesn't work then it could be an incompatability with your compiler's include headers. Try playing with the const_char macros at the start of the api.cpp source file in the PyPerforce source distribution to match the P4api and c-runtime libraries.

comment:2 Changed 11 years ago by Noah Kantrowitz

Description: modified (diff)

Fixing formatting.

comment:3 in reply to:  1 Changed 10 years ago by anonymous

Replying to lewisbaker:

This seems to be a PyPerforce build problem. It usually occurs when building PyPerforce using P4api libraries that don't match the runtime/compiler versions of used by Python.

Have a look here for the either the 'pic' libraries, if the gcc command line uses -Fpic, or the non-'pic' libraries and try rebuilding.

If that doesn't work then it could be an incompatability with your compiler's include headers. Try playing with the const_char macros at the start of the api.cpp source file in the PyPerforce source distribution to match the P4api and c-runtime libraries.

Thanks for the tip. Tried a couple of versions of the p4api after enabling the const_char macro. This worked.

comment:4 Changed 10 years ago by Lewis Baker

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Lewis Baker.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.